Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.0 - Beta
-
Fix Version/s: 4.0
-
Component/s: None
-
Labels:None
-
Environment:Viewer RI
Description
The viewer RI allows for users to select Link annotations on a page and delete them with either the 'delete' key or crt-d. The delete state is stored in the memento and can be undone or redone using the edit menu commands. There is a bound issue with the annotation is restored after a delete.
Test Case
- move an Link annotation to another location.
- delete the annotation
- now execute the undo command twice.
result after undo
- annotation will be painted at it's original location. But the annotation component will be stock in the location of the the original delete.
Test Case
- move an Link annotation to another location.
- delete the annotation
- now execute the undo command twice.
result after undo
- annotation will be painted at it's original location. But the annotation component will be stock in the location of the the original delete.
It turns out the state manager keeps a copy of the component being deleted. On an undelete I was creating a new AnnotationComponent an applying it to the current state which worked fine. However when undo was called again I was getting the references to that states component and was effectively updating the wrong component's bounds.
I changed the delete logic to no longer remove the component from the page, instead changes the visibility to false. This seems to work fine except if someone does a lot of creation and deletion there will be extra component that are invisible in the page. The object are never saved but will be a little be of extra overhead while the document is still open.