ICEpdf
  1. ICEpdf
  2. PDF-102

Undoing a deleted annotation action results in painting issue

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.



        Activity

        Hide
        Patrick Corless added a comment -

        I spent quit a bit of time looking into this issue yesterday. The component bounds do get updated as expected but the location is not updated correctly. My guess is that I'm not correctly adding the component back to the panel in a swing friendly manner. Hopefully get this fixed shortly.

        Show
        Patrick Corless added a comment - I spent quit a bit of time looking into this issue yesterday. The component bounds do get updated as expected but the location is not updated correctly. My guess is that I'm not correctly adding the component back to the panel in a swing friendly manner. Hopefully get this fixed shortly.
        Hide
        Patrick Corless added a comment -

        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.

        Show
        Patrick Corless added a comment - 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.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: