|
From: Mojca M. <moj...@gm...> - 2012-06-25 08:21:43
|
On Sat, Jun 23, 2012 at 11:23 PM, Petr Mikulik wrote: > I have revised the mouse wheel zooming, see patch: > https://sourceforge.net/tracker/?func=detail&aid=3537423&group_id=2055&atid=302055 Thank you. However (the following comments are all unrelated to your specific change), if revising the mouse, I would be very very very grateful if functions would be modified in such a way that it would be possible to specify the amount of zoom/scroll, not only large discrete steps. Currently a single scroll event moves the graph for approximately 15-40 pixels, while macs allow precise scrolling with pixel precision. On Mac mouse scrolling events return: - scrolling direction (up/down or left/right) - the number of pixels to scroll and typically one gets several events one after another. It is practically impossible, or at least very inconvenient to generate one single scrolling event for one pixel. Usually one gets 2-5 steps with very very tiny movement. Last time when I tested, a single swipe from left to right moved me from default (-10,10) to somewhere around 2000. With a single movement!!! In a native mac application that would correspond to a movement across the width of the screen. I volunteer to fix this behaviour in Qt & wxt, but there is no suitable function to call directly. At the moment I can only "forward wheel scrolling event", discarding the amount of scrolling (otherwise it would behave even worse than it does now), but that makes unproportional movement, depending on the speed of movement, not the amount of movement. So it would be very helpful to have not just zoom_around_mouse('+'); but rather something like zoom_around_mouse(1.134); Also, as soon as one uses a scrolling event, the default behaviour is the following (one example): if (((b == 5) && (modifier_mask & Mod_Shift)) || (b == 7)) { /* scroll right */ xmin = rescale(FIRST_X_AXIS, .9, .1); ymin = rescale(FIRST_Y_AXIS, 1., 0.); x2min = rescale(SECOND_X_AXIS, .9, .1); y2min = rescale(SECOND_Y_AXIS, 1., 0.); xmax = rescale(FIRST_X_AXIS, -.1, 1.1); ymax = rescale(FIRST_Y_AXIS, 0., 1.); x2max = rescale(SECOND_X_AXIS, -.1, 1.1); y2max = rescale(SECOND_Y_AXIS, 0., 1.); do_zoom(xmin, ymin, x2min, y2min, xmax, ymax, x2max, y2max); with hardcoded 10% movement. It would be a lot more useful to have a finer control of the amount of zoom & movement than just discrete hardcoded steps. I wanted to change the code, but I'm not sure where to start. From Qt I can only forward scrolling event or do some other dirty trickery without knowing much about gnuplot internals. And related to your change: on Mac it is natural to use scrolling for actually scrolling, since there are other events on trackpad which allow zooming in (they work the same as maps on smart phones, using two fingers and sliding them closer together or further apart). Redefining the meaning of scrolling means a slightly unnatural experience for mac users, but for the sake of all other more widespread OS-es and hardware and for the sake of consistency of gnuplot across platforms, it should be acceptable to use key combinations that make sense elsewhere. However ... if you redefine the meaning of scrolling event, then please provide drag-and-drop to move around the graph. Thank you, Mojca |