Industrial: Make TAnalogSensor high-dpi aware.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6856 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-04-22 14:16:01 +00:00
parent 818d8099cb
commit 950e85af8f

View File

@@ -318,14 +318,15 @@ begin
end; end;
procedure TAnalogSensor.PaintAsNeedle; procedure TAnalogSensor.PaintAsNeedle;
var MiddleX: Integer; var
MiddleX: Integer;
Angle: Double; Angle: Double;
X, Y, W, H: Integer; X, Y, W, H: Integer;
begin begin
X := 20; X := Scale96ToFont(20);
Y := 23; Y := Scale96ToFont(23);
W := ClientWidth - 2*20; //130; W := ClientWidth - 2*X;
H := ClientHeight - 2*23; //33; H := ClientHeight - 2*Y;
if (W < 1) or (H < 1) then Exit; if (W < 1) or (H < 1) then Exit;
with Canvas do with Canvas do
@@ -365,13 +366,14 @@ begin
end; end;
procedure TAnalogSensor.PaintAsHorizontal; procedure TAnalogSensor.PaintAsHorizontal;
var MiddleX: Integer; var
MiddleX: Integer;
X, Y, W, H: Integer; X, Y, W, H: Integer;
begin begin
X := 20; X := Scale96ToFont(20);
Y := 23; Y := Scale96ToFont(23);
W := ClientWidth - 2*20; //130; W := ClientWidth - 2*X;
H := ClientHeight - 2*23; //33; H := ClientHeight - 2*Y;
if (W < 1) or (H < 1) then Exit; if (W < 1) or (H < 1) then Exit;
with Canvas do with Canvas do
@@ -406,13 +408,14 @@ begin
end; end;
procedure TAnalogSensor.PaintAsVertical; procedure TAnalogSensor.PaintAsVertical;
var MiddleY: Integer; var
MiddleY: Integer;
X, Y, W, H: Integer; X, Y, W, H: Integer;
begin begin
X := 20; X := Scale96ToFont(20);
Y := 23; Y := Scale96ToFont(23);
W := ClientWidth - 2*20; //130; W := ClientWidth - 2*X;
H := ClientHeight - 2*23; //33; H := ClientHeight - 2*Y;
if (W < 1) or (H < 1) then Exit; if (W < 1) or (H < 1) then Exit;
with Canvas do with Canvas do