-
-
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(Canvas): invalidate _objectsToRender
on stack change
#9387
Conversation
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.
done
Build Stats
|
IMO this is a bad design and caching should never be implicit, rather left opt-in for the developer or even as override if needed. As a developer, I would need to dig into the source code to find out why my objects are not correctly rendered even after maybe spending hours investigating that the |
I am not sure I agree. |
But maybe we could add a flag to renderAll |
We set _objectsToRender as undefined most of the time when we need to invalidate, /**
* hold the list of objects to render
* @type FabricObject[]
* @private
*/
_objectsToRender?: FabricObject[] = []; Why? |
Nice catch |
Can we set it as |
Sounds the right way to it. |
Regarding this i don't have an opinion about this being bad or not bad. Regarding a developer digging hours and not understanding why what, that is the exact issue that i mention and why i m not releasing 6.0 without a full set of docs and explanations. |
I didn't add |
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.
applied review comments
I think it is ok to cache this but I don't mind |
is the way it gets assigned that is unfriendly with setOptions, we can add declare another time. |
Motivation
@jiayihu found a bug
Description
We forgot to invalidate
_objectsToRender
on stack changeChanges
the fix itself and a test
Gist
In Action