On Tue, Aug 5, 2008 at 9:54 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: > Christopher Barker wrote: >> to get it really smooth, I suppose you could render a larger bitmap off >> screen, so you could just drag that as you moved, and have floatcanvas >> fill in the missing bits when they are still off screen. > > I've just re-factored it a bit more -- it is now a hybrid method. As you > move the mouse, it immediately redraws the existing buffer as you move. > It then sets a timer for 30 microseconds -- when that timer goes off, > the entire image is re-drawn. > > This makes for a slight delay, which is unnecessary for images that are > fast to draw, but allows it to work OK with images that take a while to > draw.
Thanks for looking into this. However, ideally the canvas should update as I drag and not flicker in any way. I can see why this is difficult to implement: if you have many objects you have to draw them all and then move your viewport along; this would take a long time to draw initially but moves would be fluent. This is very much the same case as for scrollbars. Your viewport is smaller than your drawing. (I wouldn't know how to create a viewport that only looked at a section of a drawing). How Kiva does it, I'm not sure. /Chris _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
