Replies: 4 comments 10 replies
-
So just to clarify, you're proposing just removing the state change logic, not the entire object:modified event correct? |
Beta Was this translation helpful? Give feedback.
-
This is an important conversation because it is part of a larger discussion IMO. |
Beta Was this translation helpful? Give feedback.
-
This has now become a stumbling block to my efforts. |
Beta Was this translation helpful? Give feedback.
-
that timestamp idea is good but also a change count could be good enough.
Let me try to open a pr for that
…On Mon, 25 Apr 2022 at 06:16, Shachar ***@***.***> wrote:
I didn't look into it deeply to understand how fabric uses it.
Let's remove it then.
—
Reply to this email directly, view it on GitHub
<#7656 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJDQQBQW73VVYMPB2M4373VGYMCHANCNFSM5NVH7MBA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
FabricJS has an internal pattern to fire
object:modied
withstateful
property, that will check if the object changed color or position inspecting the properties. Similarly has an statefullCache that will detect the cache changes in case you don't use.set(prop, value)
.In my opinion is developer job to use the set method to trigger cache invalidation while the object:modified with property changes does not make sense at all because is an event that would fire on the same code changes you write.
I proposing to remove this logic completely.
This requires a bit of rework of how text detect when a new dimension change is necessary, but i think is just an automatic behaviour that on the long run brings more de-optimization than other.
With this would go away all the usages of
setupState
,hasStateChanged
,stateful
andstatefullCache
.References:
https://github.com/fabricjs/fabric.js/blob/master/src/mixins/stateful.mixin.js
Beta Was this translation helpful? Give feedback.
All reactions