From 8fccfb64efd64acf55f3ef080d8dcbf6b48bef75 Mon Sep 17 00:00:00 2001 From: juha Date: Thu, 7 May 2020 20:20:56 +0000 Subject: [PATCH] LazUtils: Do not garble LazFreeType fonts. Issue #37012, patch from circular. git-svn-id: trunk@63125 - --- components/lazutils/ttcalc.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/lazutils/ttcalc.pas b/components/lazutils/ttcalc.pas index 81e14142b6..cd8cefbd35 100644 --- a/components/lazutils/ttcalc.pas +++ b/components/lazutils/ttcalc.pas @@ -141,8 +141,15 @@ var temp: Int64; begin temp := int64(a)*int64(b); - if temp >= 0 then temp += c shr 1 - else temp -= c shr 1; + if c < 0 then + begin + c := -c; + temp := -temp; + end; + if temp >= 0 then + temp += c shr 1 + else + temp -= c shr 1; result := temp div c; end;