Number: 1396
Title: 2.20 Zooming Does Not Work Like 2.18
Submitter: AJ Palkovic
Date: Wed Jul 23 12:24:10 2008
Subsys: Output generation
Version: 2.20.2
System: x86-Linux-Fedora Core 9
Severity: minor
Problem:
In 2.18, in the gtk plugin, when the user would zoom, the plugin would focus it on the zoom coordinates of the mouse. However, in the new release, 2.20, when the user zooms closer to the edges of the canvas, the focus is no longer the coordinate of the mouse. In fact, often, the content you were zooming over will move off screen. Zooming just doesn't seem to work as well as it did in 2.18.

I've looked through the source code at the problem, and I noticed a few things. First, in lib/gvc/gvevent.c, in gvevent_button_press, cases 4 and 5, I noticed that the job->focus.x variable was being changed by the height variables. For example, the source code had this:


     job->focus.x -= (pointer.y - job->height)....
which I thought was curious, because the x focus was being changed by the y coordinate of where the user zoomed. I tried changing that to job->focus.y, but it really didn't make a difference. I also tried replacing this code and some other with code from 2.18, but that did not work either, so I assume that this is probably a problem with the values in the job struct. To compensate, right now I have changed the same code in gvevent_button_press:

* (ZOOMFACTOR - 1.) / (job->zoom * job->devscale.y);
to be * (ZOOMFACTOR - 1.) / (job->scale.y); (for all 8 places that it occurs). This seems to mitigate the problem, so it doesn't jump anywhere near as much when the user zooms around the outside of the graph, but it is not ideal. Do you have a better solution?

Also, I noticed that in the gtk plugin, the graph no longer expands to the full size of the window when the plugin starts, but it did do this in 2.18.
Owner: ellson
Status: *