← Back to team overview

kicad-developers team mailing list archive

wxDC zoom break through.

 

After a few false starts, much grepping through the wxWidgets source
code, and a lot of frustration, I have finally solved the zooming issue
using wxDC. I had to turn off the wxAutoBufferedPaintDC in the
INSTALL_PAINTDC() macro and disable the new bitmap grid drawing code to
get it to work properly but it does appear to be fully functional. I
would like to know if anyone else is interested in taking a look at to
see if I missed anything. I believe I have managed not to break
anything using the current drawing code so committing it to SVN should
be reasonably safe. I added an cmake option to make it easy to enable
and disable it. I would like it get some heavy testing to make sure it
is at least the equivalent to the current drawing code. Once it has
been tested, I recommend removing all of the existing coordinate
manipulation code to get rid the unnecessary function calls and remove
all of the ugly conditional compilation code as well. I also plan to
add a software switch to allow testing of the wxGCDC without recompiling
so that performance can be compared to the wxDC rendering see if moving
to wxGraphicsContext::Draw() code makes any sense. I know removing
wxBufferPaintDC and the bitmap grid drawing are a step backwards in
performance but it is big step forward towards removing a lot drawing
code complexity and making the move to wxGraphicsContext achievable. I
also believe that removing them is only temporary until I can figure out
what the difference between wxPaintDC and wxCientDC is in terms of
setting up the DC to calculate the coordinates correctly. I have a
sneaking suspicion that this is also why calling Refresh() or Update()
on zooming doesn't work correctly. If there are no objections, I will
commit these changes in the next couple of days.

Wayne

 




Follow ups