kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #04175
Re: Re: wxDC break through update.
-
To:
kicad-devel@xxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@...>
-
Date:
Wed, 10 Feb 2010 11:25:36 -0500
-
In-reply-to:
<4B72B4D2.8040305@...>
-
User-agent:
Thunderbird 2.0.0.23 (Windows/20090812)
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