-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Implement fill opacity for shading patterns in the SVG back-end #11927
Implement fill opacity for shading patterns in the SVG back-end #11927
Conversation
You can test this by opening the preview viewer below and running |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/9cde8c7afef8b6a/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/9cde8c7afef8b6a/output.txt Total script time: 3.27 mins Published |
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.
Looks good to me, thanks!
Super tiny nit: Shouldn't it be ca
, i.e. lower-case, in the commit message since the upper-case variant is stroke-related based on e.g.
Lines 1005 to 1011 in 3b615e4
case "CA": | |
this.current.strokeAlpha = state[1]; | |
break; | |
case "ca": | |
this.current.fillAlpha = state[1]; | |
this.ctx.globalAlpha = state[1]; | |
break; |
This confused me for a second when reading the commit message, before looking at the actual code.
In the PDF file from the issue below, the fill alpha (`ca`) is set before drawing the circles using the `setGState` operator. Doing so causes the global alpha to be set on the canvas' context for the canvas back-end, but this was not handled in the SVG back-end. This patch fixes that by taking the fill opacity into account when drawing shading patterns in the same way as done elsewhere so it is only included if the value is non-default. Fixes mozilla#11812.
28d428f
to
f14215d
Compare
Good point; I have amended the commit and PR message. Thanks! |
Thank you; as an aside you do have to wonder why anyone thought it'd be a good idea to specify two separate operators with the same name and differing only in their casing... |
In the PDF file from the issue below, the fill alpha (
ca
) is set before drawing the circles using thesetGState
operator. Doing so causes the global alpha to be set on the canvas' context for the canvas back-end, but this was not handled in the SVG back-end. This patch fixes that by taking the fill opacity into account when drawing shading patterns in the same way as done elsewhere so it is only included if the value is non-default.Fixes #11812.