gliff-ai / annotate

gliff.ai ANNOTATE – a user-friendly browser interface for annotating multidimensional images for machine learning development
https://gliff.ai
GNU Affero General Public License v3.0
2 stars 0 forks source link

Undo move point does not work as expected #281

Closed philipjackson closed 2 years ago

philipjackson commented 3 years ago

Describe the bug

Hitting undo after moving a spline point only shifts it back one tiny little bit at a time. This is because updateSplinePoint is being called in onMouseMove rather than onMouseUp when the user finishes dragging, resulting in hundreds of little updates being logged in both the audit and undo arrays. Fixing this behaviour in SplineCanvas will definitely be easier and better than somehow consolidating all those update actions into one.

To Reproduce Steps to reproduce the behavior:

  1. Make a spline
  2. Move one of its points with the select tool
  3. Hit undo

Expected behavior

Point moves back to where it was before you dragged it.

ChasNelson1990 commented 3 years ago

Just hit this myself and thinking of how to fix it, what would @SilviaZeta and @philipjackson say to having two 'updateSplinePoint' functions? https://github.com/gliff-ai/annotate/blob/452e74d7ba8daf14c524a9d352382bca45a700a6/src/annotation/index.ts#L323 The current one, which is @logged should be called on onClick/onDoubleClick/onMouseUp events and then a not-logged one, e.g. updateSplinePointAndWait function that is identical but not logged could be called on onMouseDown/onMouseMove events? Implementation wise updateSplinePoint could just call updateSplinePointAndWait or whatever we call it?

ChasNelson1990 commented 2 years ago

@philipjackson do I remember correctly that you actually did something about this?

philipjackson commented 2 years ago

Yep, this was fixed on October 4th, looks like I forgot to link the issue: https://github.com/gliff-ai/annotate/pull/375