← Back to team overview

kicad-developers team mailing list archive

[PATCH] Make RULER_ITEM generic

 

Hi,

Another in my series of patches leading up to GerbView GAL merge, this is a
quick one to enable the ruler to work in GerbView.

-Jon
From 47dfc6081c8913c8aa8e48b1f2d1d004d750b741 Mon Sep 17 00:00:00 2001
From: Jon Evans <jon@xxxxxxxxxxxxx>
Date: Mon, 11 Sep 2017 22:49:05 -0400
Subject: [PATCH] Make RULER_ITEM generic and ensure text mirroring is disabled

---
 common/preview_items/ruler_item.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/preview_items/ruler_item.cpp b/common/preview_items/ruler_item.cpp
index 8afee9f16..3ec3d51a4 100644
--- a/common/preview_items/ruler_item.cpp
+++ b/common/preview_items/ruler_item.cpp
@@ -232,7 +232,7 @@ void RULER_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
 void RULER_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
 {
     auto& gal = *aView->GetGAL();
-    auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
+    auto rs = static_cast<KIGFX::RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
 
     const auto origin = m_geomMgr.GetOrigin();
     const auto end = m_geomMgr.GetEnd();
@@ -240,6 +240,8 @@ void RULER_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
     gal.SetLineWidth( 1.0 );
     gal.SetIsStroke( true );
     gal.SetIsFill( false );
+
+    gal.SetTextMirrored( false );
     gal.SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ) );
 
     gal.ResetTextAttributes();
-- 
2.11.0


Follow ups