Re: RE: Scrolling a drawing area



On Mon, 2008-05-19 at 11:39 +0300, Dov Grobgeld wrote:
> 
> 
> 2008/5/11 Lindley M French <lfrench1 gmu edu>:
>         [stuff deleted]
>         
>         Be warned: Due to the way resizing works in GTK+, it's
>         impossible to do "smooth zooming" where your scrolled window
>         remains focused on the same part of the image as you zoom. You
>         can approximate it, but the zoom itself will be jerky. I
>         haven't found any way around this.
> 
> Not sure what you mean by this. I'm doing zoom-in in my image viewer
> giv (http://giv.sf.net/giv) through the GtkImageViewer widget (which
> is currently bundled in giv under the name DovImageViewer). The
> ImageViewer widget takes care to zoom in so that the position of the
> mouse is centered in the zoomed in image... But perhaps you meant
> something else?

the problem is this ... when a GtkWidget ends up using XMoveWindow to
reset the "origin" for the visible part of itself, and then follows up
with a redraw of the entire window contents, these two things happen
asynchronously. The XServer takes care of the window move, then the
client redraws. Many (all?) of the existing GtkWidgets that one might
use for this sort of thing all gdk_move_window() to do the origin move,
and are thus subject to this problem.

What is actually needed for this purpose is just a widget which
differentiates between:
 
       * scroll
       * zoom with constant window origin coordinates
       * zoom with constant non-origin focus

right now, too many of them take the easy way out, and do the third case
as a combination of the first and second. on X Window, this always
results in a double draw of the window.

--p




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]