-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
fix(): abort concurrent rendering #8218
Conversation
I don't like this change.
There is an option to hide the whitespace changes that is good enough. |
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.
Seems ready to me
Please look at the second comment closely
@@ -703,7 +687,23 @@ import { removeFromArray } from './util/internals'; | |||
*/ | |||
requestRenderAll: function () { | |||
if (!this.isRendering) { | |||
this.isRendering = fabric.util.requestAnimFrame(this.renderAndResetBound); | |||
new Promise((resolve, reject) => { | |||
const controller = new AbortController(); |
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.
polyfill needed for node<16
@@ -748,7 +763,6 @@ import { removeFromArray } from './util/internals'; | |||
*/ | |||
renderCanvas: function(ctx, objects) { | |||
var v = this.viewportTransform, path = this.clipPath; | |||
this.cancelRequestedRender(); |
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.
This is an important fix
Before, if you would called Canvas#toCanvasElement
it would have cancelled requested renders. Or was it intentional.
I guess now there could be some nasty race condition.
we had a concurrent review it seems FYI it did abort it. Not only took more time. |
This fix introduces the ability to abort a concurrent render cycle by calling
abortRendering
Probably fixes a lot of issues that were reported on
calling "XXX" on null ctx
that were silenced because of qunitIt committed whitespace without my intention. And I don't want to pick out the trouble. Isn't there a git cmd to revert whitespace? Sound useful