← Back to team overview

kicad-developers team mailing list archive

Re: specctra roundtripper

 

> wxRound may be overkill but it does one important thing that will become
> apparent when I commit the code that scales the PCB_SCREEN zoom factors
> to work properly with nanometer internal units.  In debug builds,
> wxRound tests if the floating point result is within INT_MIN and INT_MAX
> and raises an assertion if it is not.  I found out that this assertion
> occurs in the wxDC::LogicalToDevice() functions when zooming way out
> when Pcbnew is compiled for nanometers.  This may not bode well for
> nanometers until we change to a new device context such as OpenGL.  In
> the interim, I will make the new file loader support both nanometer and
> deci-mil internal units just in case.
>
> Wayne

You are going above and beyond the call of duty here.  Thank you for your efforts.

There is no expectation that you have to make PCBNEW work at nanometer resolution.  That
is not in the current work package.

The UI stuff is clearly not in that work scope.

The attached patch gets around the assert that you found.  But we need an assert in
SetZoom() which traps bad values.  (Thank goodness for accessor use.  Here we see why they
are useful.)

But there is more work here, and that is to be expected.  No need to panic, nor to do more
than what would turn you into a pumpkin.  But we definitely want you looking like a squash.

Thanks tons for all your work,

Dick


=== modified file 'common/drawframe.cpp'
--- common/drawframe.cpp	2012-03-26 23:47:08 +0000
+++ common/drawframe.cpp	2012-04-13 21:04:56 +0000
@@ -368,7 +368,7 @@
     else
     {
         id--;
-        int selectedZoom = GetScreen()->m_ZoomList[id];
+        double selectedZoom = GetScreen()->m_ZoomList[id];
 
         if( GetScreen()->GetZoom() == selectedZoom )
             return;


Follow ups

References