From 8b49c6e5ed0fcb08573fdfdce12e8f4b91a0408c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 5 May 2017 15:04:29 +1000 Subject: [PATCH] Alter selection area colours based on selection mode - Left to Right is slightly blue (as current) - Right to left is slightly green --- common/preview_items/selection_area.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/preview_items/selection_area.cpp b/common/preview_items/selection_area.cpp index f66cb1deed..a1a4813c22 100644 --- a/common/preview_items/selection_area.cpp +++ b/common/preview_items/selection_area.cpp @@ -29,6 +29,10 @@ using namespace KIGFX::PREVIEW; +// Selection area colours +const COLOR4D SELECT_COLOR_L2R( 0.3, 0.3, 0.5, 0.3 ); // Slight blue +const COLOR4D SELECT_COLOR_R2L( 0.3, 0.5, 0.3, 0.3 ); // Slight green + SELECTION_AREA::SELECTION_AREA() { @@ -50,6 +54,9 @@ const BOX2I SELECTION_AREA::ViewBBox() const void SELECTION_AREA::drawPreviewShape( KIGFX::GAL& aGal ) const { + // Set the fill color based on the direction of selection + aGal.SetFillColor( ( m_origin.x <= m_end.x ) ? SELECT_COLOR_L2R : SELECT_COLOR_R2L ); + aGal.DrawRectangle( m_origin, m_end ); }