Closed axelboc closed 2 weeks ago
Replacing the dummy shape { type: 'NONE' }
with undefined
in the context menu state seems to have caused some issues in the showModal
method. Apologies, I'll investigate.
I've used optional chaining in showModal
to handle an undefined shape
. In the other methods, the shape
prop is always defined.
I now store
e.offset<X|Y> / imageRatio
instead of juste.offset<X|Y>
in the state, which savesContextMenu
from having to do this calculation in a couple of places.I've made a couple of additional commits to move some logic around, inline some methods, etc., and to let the right-clicked shape be
undefined
in the state (instead of storing a fake shape object{ type: 'NONE' }
).