Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign of SvgPaintServer decision in SvgPaintServerFactory. #564

Merged
merged 9 commits into from
Sep 11, 2019

Conversation

H1Gdev
Copy link
Contributor

@H1Gdev H1Gdev commented Aug 28, 2019

Reference Issue

Ref. #114 and #455 .

What does this implement/fix? Explain your changes.

Any other comments?

_fallbackServer = FallbackServer;
if (!(_fallbackServer is SvgColourServer ||
(_fallbackServer is SvgDeferredPaintServer && string.Equals(((SvgDeferredPaintServer)_fallbackServer).DeferredId, "currentColor"))))
_fallbackServer = Inherit;
Copy link
Contributor Author

@H1Gdev H1Gdev Aug 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same behavior as major browsers.


namespace Svg
{
internal class SvgDeferredPaintServerFactory : SvgPaintServerFactory
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I create this Factory for xlink:href because SvgPaintServerFactory cannot make an accurate decision.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a bit of explanation to the factory or the ConvertFrom method? It took some time for me to understand why it is needed...

<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="default" width="80" height="80">
<defs>
<linearGradient id="mycolor" xlink:href="#ff0000" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ID like color format.

@tebjan tebjan force-pushed the master branch 2 times, most recently from 55d5c65 to 7de872a Compare August 30, 2019 21:53
@@ -9,6 +9,7 @@ namespace Svg
/// <summary>
/// A wrapper for a paint server has a fallback if the primary server doesn't work.
/// </summary>
[Obsolete("Will be removed.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have an explanation or something like "Use xxx instead" as a message instead of "Will be removed" (which is already the meaning of Obsolete).

}
else if (value == "inherit")
{
else if (string.Equals(colorValue, "none", StringComparison.OrdinalIgnoreCase))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to use the instance methods here, e.g. colorValue.Equals("none", StringComparison.OrdinalIgnoreCase), though that is a matter of taste.

else if (value == "inherit")
{
else if (string.Equals(colorValue, "none", StringComparison.OrdinalIgnoreCase))
// none
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-explanatory - no comments needed here

Copy link
Member

@mrbean-bremen mrbean-bremen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, apart from some minor comment issues, though it would be nice if someone else could have a look (@gvheertum, @wieslawsoltes ?)

i++;
}
return count;
#if NETSTANDARD20
Copy link
Contributor Author

@H1Gdev H1Gdev Sep 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrbean-bremen
@wieslawsoltes

I am trying to rebase.
But I do not understand policy of netstandard2.0 support.(#509 )

If disable SvgColourConverter, SvgPaintServerFactory will hardly work.
So is this all right now ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Netstandard2 is not fully supported yet (especially SvgColourConverter), so this looks ok to me.
@wieslawsoltes - can you also have a look?

@mrbean-bremen mrbean-bremen merged commit 8307612 into svg-net:master Sep 11, 2019
@H1Gdev H1Gdev deleted the painting branch September 11, 2019 22:13
H1Gdev added a commit to H1Gdev/SVG that referenced this pull request Jan 11, 2021
- Make up for PR svg-net#564.
- Fixes part of svg-net#779.
@H1Gdev H1Gdev mentioned this pull request Jan 11, 2021
mrbean-bremen pushed a commit that referenced this pull request Jan 11, 2021
- Make up for PR #564.
- Fixes part of #779.
H1Gdev added a commit to H1Gdev/SVG that referenced this pull request Jan 11, 2021
- Pass pservers-pattern-03-f.svg.
@H1Gdev H1Gdev mentioned this pull request Jan 11, 2021
mrbean-bremen pushed a commit that referenced this pull request Jan 11, 2021
- Corrects PR #564
- W3C test file  pservers-pattern-03-f.svg now correctly rendered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants