From c4117c1ecfb69762ab939c513a1d984122977b4c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 17 Dec 2020 17:44:58 +0000 Subject: [PATCH] Adjust text and shadow offsets for flipped view. Fixes https://gitlab.com/kicad/code/kicad/issues/6776 --- common/preview_items/ruler_item.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/preview_items/ruler_item.cpp b/common/preview_items/ruler_item.cpp index e0827bfd3d..9bebb2df2f 100644 --- a/common/preview_items/ruler_item.cpp +++ b/common/preview_items/ruler_item.cpp @@ -165,6 +165,12 @@ void drawTicksAlongLine( KIGFX::VIEW* aView, const VECTOR2D& aOrigin, const VECT double majorTickLen = aMinorTickLen * ( majorTickLengthFactor + 1 ); VECTOR2D labelOffset = tickLine.Resize( majorTickLen - textOffset ); + if( aView->IsMirroredX() ) + { + textOffset = -textOffset; + labelOffset = -labelOffset; + } + if( aLine.Angle() > 0 ) { gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );