On Mar 23, 2007, at 6:11 PM, Mathieu Peyréga wrote: > Hello, > > I have a MyWidget class wich is a subclass of Fl_Scroll in which i > overloaded the draw() method. > > almost everything works fine... except that the drawing done through > fl_begin_line() ... are not redrawn correctly when I use the > scrollbars... > The former drawing is not erased and overlap with the new one. > Everithing is drawn correctly if a redraw() occurs... > Is there a way to correct this behaviour ? (using push_clip or > something > like that ?)
Well, the Fl_Scroll adds some funkyness to drawing. First of all, you must make sure that all drawing code uses the widgets x() and y() as an origin, because Fl_Scroll will move the widget coordinates. Secondly, if you scroll less than the size of the whole widget (which is usually the case), Fl_Scroll will minimize the amount of drawing that you will have to do by moving as much screen contents around as possible and then calling "draw()" with only those areas clipped in that actually need redrawing. So if you don't get the coordinates exactly right, you may end up with jaggies or double lines. If nothing helps, maybe you can boil some code down to a single page and post it here. > it's a digital terrain horizon blocking and sun trajectory computer... > (should be used later to optimize solar panel orientation... or to > predict the effective received power) Sounds great! ---- http://robowerk.com/ _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

