From 5e2721d2f5bd70028921d80caf962a2b4027fc48 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 23 Oct 2019 22:00:01 -0700 Subject: [PATCH] Increase visibility of polygon preview This set the polygon preview item to wider size and adjusts the draw order to ensure it remains visible even when antialiasing (cherry picked from commit ea1c8525ce8df5be9bc87cd8d45d62c18b9d7f32) --- common/preview_items/polygon_item.cpp | 5 ++++- include/preview_items/polygon_item.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/preview_items/polygon_item.cpp b/common/preview_items/polygon_item.cpp index 3802b186cb..d7d5d79297 100644 --- a/common/preview_items/polygon_item.cpp +++ b/common/preview_items/polygon_item.cpp @@ -31,6 +31,7 @@ using namespace KIGFX::PREVIEW; +const double POLYGON_ITEM::POLY_LINE_WIDTH = 150000.0; POLYGON_ITEM::POLYGON_ITEM(): SIMPLE_OVERLAY_ITEM() @@ -60,12 +61,14 @@ void POLYGON_ITEM::drawPreviewShape( KIGFX::VIEW* aView ) const auto& gal = *aView->GetGAL(); auto rs = static_cast( aView->GetPainter()->GetSettings() ); + gal.SetLineWidth( POLY_LINE_WIDTH ); gal.DrawPolyline( m_lockedChain ); - gal.DrawPolygon( m_polyfill ); // draw the leader line in a different color gal.SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ) ); gal.DrawPolyline( m_leaderChain ); + + gal.DrawPolygon( m_polyfill ); } diff --git a/include/preview_items/polygon_item.h b/include/preview_items/polygon_item.h index 61d59a9b3a..67a10f68ef 100644 --- a/include/preview_items/polygon_item.h +++ b/include/preview_items/polygon_item.h @@ -75,6 +75,8 @@ private: ///> polygon fill SHAPE_POLY_SET m_polyfill; + + static const double POLY_LINE_WIDTH; }; } // PREVIEW