From 4ed3c99e3e075ccde3ed2997df5adced4dcfe4ea Mon Sep 17 00:00:00 2001 From: aapo-aapo <74315529+aapo-aapo@users.noreply.github.com> Date: Fri, 27 Nov 2020 22:15:16 +0200 Subject: [PATCH] Update src/Mod/TechDraw/Gui/QGCustomText.cpp by compacting boundingRect() Co-authored-by: Chris Hennes --- src/Mod/TechDraw/Gui/QGCustomText.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Mod/TechDraw/Gui/QGCustomText.cpp b/src/Mod/TechDraw/Gui/QGCustomText.cpp index 9cf2761b7e..78ba50285a 100644 --- a/src/Mod/TechDraw/Gui/QGCustomText.cpp +++ b/src/Mod/TechDraw/Gui/QGCustomText.cpp @@ -195,13 +195,11 @@ QRectF QGCustomText::boundingRect() const { if (toPlainText().isEmpty()) { return QRectF(); - } - - if (tightBounding) { + } else if (tightBounding) { return tightBoundingRect(); + } else { + return QGraphicsTextItem::boundingRect(); } - - return QGraphicsTextItem::boundingRect(); } QRectF QGCustomText::tightBoundingRect() const @@ -254,4 +252,3 @@ void QGCustomText::makeMark(Base::Vector3d v) makeMark(v.x,v.y); } -