← Back to team overview

kicad-developers team mailing list archive

PATCH: partial fix to bug 1255937

 

The attached patch is a partial fix to bug 1255937.

Symptom: Pad outlines (arcs) in the back silk and mask are rendered incorrectly
(arc drawn in wrong direction) when a mirrored image is printed.

This patch works by checking the Device Origin and if the Y coordinate is not
0 it is assumed that the X axis is reversed. I would appreciate any comments
on this proposed solution; I don't know the code well enough to know if it is
possible to have a non-zero Y origin in another possibly future context
(for example, drawing on screen with the X orientation reversed).

Unfortunately this patch does not quite close the bug yet; there are other
related artifacts which I am still investigating.

The patch is against rev. 4679

- Cirilo
=== modified file 'common/gr_basic.cpp'
--- common/gr_basic.cpp	2014-01-18 09:07:05 +0000
+++ common/gr_basic.cpp	2014-02-09 07:52:14 +0000
@@ -756,6 +756,17 @@
         DC->DrawLine( sx2, sy2, ex2, ey2 );
     }
 
+    wxCoord coordx, coordy;
+    DC->GetDeviceOrigin( &coordx, &coordy );
+
+    if( coordy > 0 )
+    {
+        if( swap_ends )
+            swap_ends = false;
+        else
+            swap_ends = true;
+    }
+
     if( swap_ends )
     {
         DC->DrawArc( sx2, sy2, sx1, sy1, x1, y1 );


Follow ups