Skip to content

zoom/pan stack bug in 2.1.0 #9358

Closed
Closed
@DeadParrot

Description

@DeadParrot

For plots after the first one created on a canvas the zoom/pan stacks can have _pos == -1 and, due to a change in 2.1.0 (fb83117), this position offset error causes unzoom and unpan back operations to think they have reached the top of the stack one step before they have.

The code change that causes this was the removal of these lines from press_pan and press_zoom:

if self._views.empty():
    self.push_current()

which reset the Stack _pos to 0. Restoring this code corrects the issue but may not be the desired fix given the intended refactoring.

Matplotlib version

  • Operating system: Windows
  • Matplotlib version: 2.1.0
  • Matplotlib backend (print(matplotlib.get_backend())): Qt4Agg
  • Python version: 2.7.14
  • Other libraries: latest NumPy, PySide, ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions