← Back to team overview

kicad-developers team mailing list archive

Re: Re: wxDC break through update.

 

Wayne Stambaugh wrote:
> jean-pierre.charras@... wrote:
>> USE_WX_ZOOM under Windows (XP) (wxGCDC not tested):
>> ratsnest in incorrectly drawn when one end of a ratsnest line is outside 
>> the visible area.
>> (not drawn or bad position)
> 
> I'll take a look at this some time today. I probably missed a call to
> Scale or UnScale that needs to converted to LogicalToDevice or
> DeviceToLogical somewhere in the ratsnest code.
> 
> Wayne

JP,

I figured it out. It's clip_line() in gr_basic.cpp that is the problem.
When USE_WX_ZOOM is enabled, all of the coordinates are in drawing
(logical) units not screen (device) units. Therefore, coordinates can
have negative values and casting them to unsigned int in the function
USCALE() causes the problem. This should not be a problem for the known
Windows bug because wxDC::LogicalToDevice() will translate the
coordinates to screen units and only items that are visible in the
current screen will get drawn. The change didn't appear to cause any
problems on GTK either. I just committed the changes so let me know if
you find any other problems.

Wayne

 




Follow ups

References