From 86e2bf93cf4723f73bfa6b33ac3e76519928132a Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 24 Jan 2017 22:57:47 -0500 Subject: [PATCH] When scaling text, first round the scaling factor... ... to the nearest 2 decimal places. This fixes a bug where upon loading a text item, it could be scaled by e.g 0.999999, which would eventually round down the point size by 1pt. Making the text item shrink by 1pt every time the document was opened. --- src/domain/UBGraphicsTextItemDelegate.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index 1d9267b6..4e4a5c50 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -532,6 +532,9 @@ bool UBGraphicsTextItemDelegate::keyReleaseEvent(QKeyEvent *event) void UBGraphicsTextItemDelegate::ChangeTextSize(qreal factor, textChangeMode changeMode) { + // round it to the nearest hundredth + factor = floor(factor*100+0.5)/100.; + if (scaleSize == changeMode) { if (1 == factor)