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 19:12:53 +0100
Thunderbird 220.127.116.11 (Windows/20080213)
Dick Hollenbeck a écrit :
void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) uses an
wxRegionIterator to redraw only damaged rectangles,
and WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg ) uses a
wxDCClipper to redraw only this rectangle.
I hope (and believe) this code is working, and perhaps calling
wxWindow::Refresh(bool eraseBackground = true, const wxRect* rect =
NULL) (or RefreshRect) with a non NULL wxRect* rect parameter could do
(Besides the class MODULE handles the rectangle coordinate which
contains the entire module (.m_BoundaryBox member) )
I tested the new code about delete track segment on a very large board
(8 layers, 4000 pads 1350 vias...)
It is reasonably fast on my PC ( a low cost computer which is 4 years old).
An enhancement could be to redraw only the region modified in order to
reduce the flicker (all kicad draw functions already use a clip box).
If we can do this inside of the event loop then I think this is a good
idea. If you are talking about doing it "in line" and not in the event
loop, then I don't think this is a good idea. (The MAC boys have
complained about unnecessary stuff happening outside the event loop.)
Normally when the event loop dispatches to the application it can pass
the dirty rectangle and this is what I think would be an improvement,
but only if Kicad can handle it there.
Looking at *void* wxWindow::*Refresh*(*bool*/ eraseBackground = true/,
*const wxRect <cid:part1.04050801.07080900@...>* */rect = NULL/)
we see that it takes a "dirty" rectangle, a subset of the window to
repaint or to mark as dirty. And this would be consistent with working
with the event loop properly.
Can Kicad receive this dirty rectangle in its event dispatcher and pay
attention to it? If yes, then great, if not...... well we could add
the dirty rect to the call, and later pay attention to the rectangle.
Please let me know and if there is an example, please point me to it and
I will be happy to add this support to my patch.
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