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
This commit is contained in:
wp_xxyyzz
2019-12-14 11:32:22 +00:00
parent 6855104312
commit 19d30d6871

View File

@ -158,11 +158,11 @@ begin
roHorizontal: proportion := AYProportion; roHorizontal: proportion := AYProportion;
roVertical: proportion := AXProportion; roVertical: proportion := AXProportion;
end; end;
if not IsStoredMarkerSize then if IsStoredMarkerSize then
FMarkerSize := round(FMarkerSize * proportion); FMarkerSize := round(FMarkerSize * proportion);
if not IsStoredMajorTickLength then if IsStoredMajorTickLength then
FMajorTickLength := round(FMajorTickLength * proportion); FMajorTickLength := round(FMajorTickLength * proportion);
if not IsStoredMinorTickLength then if IsStoredMinorTickLength then
FMinorTicklength := round(FMinorTickLength * proportion); FMinorTicklength := round(FMinorTickLength * proportion);
end; end;
end; end;
@ -273,7 +273,7 @@ begin
if UseUnit = ruPixels then if UseUnit = ruPixels then
S := IntToStr(PX) S := IntToStr(PX)
else else
S := IntToStr(Trunc(X)); S := IntToStr(Round(X));
R := Rect(PX - TextWidth(S), 0, PX + TextWidth(S), h); R := Rect(PX - TextWidth(S), 0, PX + TextWidth(S), h);
ts.Alignment := taCenter; ts.Alignment := taCenter;
TextRect(R, R.Left, R.Top, S, ts); TextRect(R, R.Left, R.Top, S, ts);
@ -291,7 +291,7 @@ begin
if UseUnit = ruPixels then if UseUnit = ruPixels then
S := IntToStr(PY) S := IntToStr(PY)
else else
S := IntToStr(Trunc(Y)); S := IntToStr(Round(Y));
R := Rect(0, PY - TextHeight(S), w, PY + TextHeight(S)); R := Rect(0, PY - TextHeight(S), w, PY + TextHeight(S));
ts.Layout := tlCenter; ts.Layout := tlCenter;
TextRect(R, R.Left, R.Top, S, ts); TextRect(R, R.Left, R.Top, S, ts);