Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZoomTool: bad behavior of aspect_ratio #191

Open
SDiot opened this issue Apr 22, 2014 · 1 comment
Open

ZoomTool: bad behavior of aspect_ratio #191

SDiot opened this issue Apr 22, 2014 · 1 comment

Comments

@SDiot
Copy link

SDiot commented Apr 22, 2014

Hello,

I was trying to use the aspect_ratio keyword of ZoomTool and was expecting:

  1. the blue overlay that show the box zoom to be forced to respect the aspect_ratio
  2. the final zoomed view to correspond to the blue overlay

Unfortunately, while 1) is indeed the case, 2) is not. The zoom is actually done according to the mouse position at the time of unclicking. I think that is a bug since it implies that the aspect_ratio is not respected.

Looking at the file better_selecting_zoom.py, this is due to self._screen_end being set to (event.x, event.y) when entering _end_select on line 330. Because of that the appropriate value of self._screen_end that is set in selecting_mouse_move according to the aspect_ratio keyword is forgotten.

After commenting line 330 of file better_selecting_zoom.py, I obtain the exact behavior I was expecting.

A simple example is given here: https://github.com/SDiot/chaco_troubles/blob/master/ZoomTool_AspectRatio.py

I think that this is a bug and should be fixed. If it's not, please let me know why! :)

Thanks!

S.D.

@SDiot
Copy link
Author

SDiot commented Apr 23, 2014

I've just seen that this corresponds to the pull request #132 but this pull request has no been finished...

The example I give above shows the bad behaviour: Just have to follow the steps given in the file doc string!

Cheers,

S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant