From 19d30d68719e6034aba677a9a5d0708af243192b Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 14 Dec 2019 11:32:22 +0000 Subject: [PATCH] jvcllaz: Fix issues with LCLScaling and label rounding in TJvRuler git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7209 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jvcllaz/run/JvCtrls/jvruler.pas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/jvcllaz/run/JvCtrls/jvruler.pas b/components/jvcllaz/run/JvCtrls/jvruler.pas index 6c7e6129a..3baa94a58 100644 --- a/components/jvcllaz/run/JvCtrls/jvruler.pas +++ b/components/jvcllaz/run/JvCtrls/jvruler.pas @@ -158,11 +158,11 @@ begin roHorizontal: proportion := AYProportion; roVertical: proportion := AXProportion; end; - if not IsStoredMarkerSize then + if IsStoredMarkerSize then FMarkerSize := round(FMarkerSize * proportion); - if not IsStoredMajorTickLength then + if IsStoredMajorTickLength then FMajorTickLength := round(FMajorTickLength * proportion); - if not IsStoredMinorTickLength then + if IsStoredMinorTickLength then FMinorTicklength := round(FMinorTickLength * proportion); end; end; @@ -273,7 +273,7 @@ begin if UseUnit = ruPixels then S := IntToStr(PX) else - S := IntToStr(Trunc(X)); + S := IntToStr(Round(X)); R := Rect(PX - TextWidth(S), 0, PX + TextWidth(S), h); ts.Alignment := taCenter; TextRect(R, R.Left, R.Top, S, ts); @@ -291,7 +291,7 @@ begin if UseUnit = ruPixels then S := IntToStr(PY) else - S := IntToStr(Trunc(Y)); + S := IntToStr(Round(Y)); R := Rect(0, PY - TextHeight(S), w, PY + TextHeight(S)); ts.Layout := tlCenter; TextRect(R, R.Left, R.Top, S, ts);