Closed heliosdrm closed 4 years ago
Nonsense: It was just the same.
Sorry for the confusion. It's only the same if x and y is 0, so I reopen it.
Thanks for your pull request! We tested your code and unfortunately it breaks existing applications for us.
Currently, x
and y
are used as a fixed focus point (if xzoom
and yzoom
are unequal 0
), so gr_panzoom
can be used in GUI applications to zoom onto a given mouse position for example. Your patch causes the zoom box to be centered around the given x
and y
coordinates which leads to a shift of the focus point.
What exactly do you want to achieve?
As it is now, if xzoom == 1
and yzoom == 1
, then gr_panzoom
returns the coordinates of the current window without modification, whatever x
and y
you pass. I had thought that it had to return the coordinates of a window whose center is displaced (x, y) from the current center, thus the change in the PR.
Thanks for the explanation.
Hi, I now understand that it works like this:
I had thought that "panzoom" meant a two-step action: (1) pan, and then (2) zoom. But this makes sense, so I close the PR.
You can use gr_panzoom
for panning when passing xzoom = 0
and yzoom = 0
. In this case x
and y
are an offset for the pan operation.
Make the center of the calculated coordinates consistent with the displacement indicated by
x
,y
, regardless of the value ofxzoom
oryzoom