-
Notifications
You must be signed in to change notification settings - Fork 10k
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
avoid apply transform twice for composite context #6906
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/dfc20518eb1849a/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/dfc20518eb1849a/output.txt Total script time: 0.82 mins Published |
@@ -856,7 +856,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { | |||
|
|||
if (this.transparentCanvas) { | |||
this.ctx = this.compositeCtx; | |||
this.ctx.save(); |
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.
Shall we just call this.ctx.restore()
here one more time instead? We have non-pair this.ctx.save() in the beginDrawing method.
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.
that save
is called on this.transparentCanvas
but in here we want this.compositeCtx
have identity transform
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.
oh, I understand this part. By looking at beginDrawing, will just restore()
do the same thing?
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.
Just tried and it doesn't work. Because the initial transformation for the canvas is not identity so restore it will not undo the transformation.
@yurydelendik @timvandermeij Is this code good to merge? |
Okay, let's take it. Thank you for the patch. |
avoid apply transform twice for composite context
/botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 1 Live output at: http://107.22.172.223:8877/d2ad7da48090d53/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/d2ad7da48090d53/output.txt Total script time: 20.79 mins
|
Fixes #6899
This change is