kicad-developers team mailing list archive
Mailing list archive
Re: Re: redraw on erase track segment
jean-pierre charras <jean-pierre.charras@...>
Wed, 05 Mar 2008 21:10:56 +0100
Thunderbird 18.104.22.168 (Windows/20080213)
Dick Hollenbeck a écrit :
I now understand what Kicad is capable of by looking at
void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
But to be honest, that code looks wrong:
1) We don't really pay attention to the dirty rect other than setting
the clipping area. (There is no subset of the draw list decision
Kicad does *much more* than set the clipping area!
All basic graphic items (circles, lines, .. seen gr_basic.cpp) ) are
drawn only if in this clipping box.
But the primary goal was not speed up.
I wrote this code because under windows all draw coordinates are in 16
bits format (an other very good idea from Microsoft).
Because kicad uses 32 bits coordinates (it was started as soon as i
found a free 32 bits compiler (DJGPP, and a free graphic library,
LIBGRX) for drawing, you can imagine what happens...
Kicad was merely unuseable under Windows !.
But it was important for me kicad was able to run under many operating
So, I was forced to write draw functions which handle the zoom level and
use a clip box to draw objects only if in this clip box, and clip basic
items (mainly lines) in order to draw
graphics items using the 16 bit limited draw coordinates under Window
(at this time, W95).
Under Xwindows, this problem did not occurs but i found some related
problems when drawing circles and ellipses, this clipping is usefull.
2) We are actually going through the entire Kicad drawing code for as
many times as there are dirty regions. Well ok, I would assume the
number of dirty regions is probably normally exactly one most of the
time. (But this may soon change if we implement the entire track
delete with a number of dirty rectangles.)
I wonder if it would be better to create a union of all the dirty
rectangles, use that as the clipping region, then call our ReDraw()
I also believe ReDraw() must be called only once.
In any case this may be a discussion for another day if we want to
speed things up a little.
It is true... this is not the more important feature.
I will try the dirty region technique on my patch from yesterday. I
just have to compute the bounding box of a single track.
Maître de conférences
Directeur d'études 2ieme année.
Génie Electrique et Informatique Industrielle 2
Institut Universitaire de Technologie 1 de Grenoble
BP 67, 38402 St Martin d'Heres Cedex
GIPSA-LIS - INPG
46, Avenue Félix Viallet
38031 Grenoble cedex