summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-04-07 18:11:48 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-02 07:29:39 +0200
commit0806d9799a74a4d71699ea1499b24a18e264c329 (patch)
tree64eab45b48aa64f41d48836ff62a33b36205b556 /src/gui/text
parentbc922223cf11eae34a5e7ad311258da1c030124f (diff)
Fix misuses of 0.9999 constant
Replace it with floor and round. It appears the old behavior was to work around combining ceil with inaccurate FP, but it doesn't appear this hacky ceil is needed. Change-Id: I5c16ec0fa4916e17198a733c46937fde53f2ddb5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/windows/qwindowsfontengine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/windows/qwindowsfontengine.cpp b/src/gui/text/windows/qwindowsfontengine.cpp
index 06c21d930b..545b5459e2 100644
--- a/src/gui/text/windows/qwindowsfontengine.cpp
+++ b/src/gui/text/windows/qwindowsfontengine.cpp
@@ -626,8 +626,8 @@ qreal QWindowsFontEngine::minRightBearing() const
fmr = qMin(fmr,abc[i].abcfC);
}
}
- ml = int(fml - 0.9999);
- mr = int(fmr - 0.9999);
+ ml = qFloor(fml);
+ mr = qFloor(fmr);
delete [] abc;
}
lbearing = ml;