-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fixing #116: PaintComposite with an unbounded source #118
Conversation
60e6803
to
d912a63
Compare
if path is None: | ||
self._warn( | ||
"unbounded", | ||
"SVG canvas currently does not support unbounded draw operations", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if you want to go that route, but in nanoemoji.colr_to_svg (where we translate from COLR => SVG) we special case a src-in PaintComposite with transparent black PaintSolid background to mean SVG's group-level opacity, since that pattern is so common:
Also, I wonder, since your SVGSurface already knows its viewBox, if you could just use that when you find an unbounded paint, as if the unbounded paint were implicitly bounded by a rectangle the size of the viewbox.. though I am not sure when/whether SVG renderers would clip shapes outside the viewbox rectangle, I think it depends on the overflow
property but IIRC its default changes depending on whether it's applied on the root <svg>
element of a standalone document or not..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bigger problem is that the SVG backend doesn't implement composition to begin with. Once that's there, your second suggestion may indeed help to overcome the problem.
This fixes #116.
Fix each backend
Note this should be generalized to the non-solid paint canvas methods.
Needs a test font + test glyph.