You've already forked lazarus-ccr
RxFPC: fix rxclock on gtk3
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8007 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -254,12 +254,18 @@ end;
|
|||||||
|
|
||||||
function VertEquiv(l: Integer): Integer;
|
function VertEquiv(l: Integer): Integer;
|
||||||
begin
|
begin
|
||||||
VertEquiv := Longint(l) * AspectV div AspectH;
|
if AspectH<>0 then
|
||||||
|
VertEquiv := Longint(l) * AspectV div AspectH
|
||||||
|
else
|
||||||
|
Result:=Longint(l) * AspectV;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function HorzEquiv(l: Integer): Integer;
|
function HorzEquiv(l: Integer): Integer;
|
||||||
begin
|
begin
|
||||||
HorzEquiv := Longint(l) * AspectH div AspectV;
|
if AspectV<>0 then
|
||||||
|
HorzEquiv := Longint(l) * AspectH div AspectV
|
||||||
|
else
|
||||||
|
HorzEquiv := Longint(l) * AspectH;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function LightColor(Color: TColor): TColor;
|
function LightColor(Color: TColor): TColor;
|
||||||
@ -302,8 +308,17 @@ begin
|
|||||||
finally
|
finally
|
||||||
ReleaseDC(0, DC);
|
ReleaseDC(0, DC);
|
||||||
end;
|
end;
|
||||||
AspectV := (Longint(VRes) * MmPerDm) div Longint(vSize);
|
|
||||||
AspectH := (Longint(HRes) * MmPerDm) div Longint(hSize);
|
if vSize<>0 then
|
||||||
|
AspectV := (Longint(VRes) * MmPerDm) div Longint(vSize)
|
||||||
|
else
|
||||||
|
AspectV := (Longint(VRes) * MmPerDm) {div Longint(vSize)};
|
||||||
|
|
||||||
|
if hSize<>0 then
|
||||||
|
AspectH := (Longint(HRes) * MmPerDm) div Longint(hSize)
|
||||||
|
else
|
||||||
|
AspectH := (Longint(HRes) * MmPerDm) {div Longint(hSize)};
|
||||||
|
|
||||||
CircleTab := PPointArray(@ClockData);
|
CircleTab := PPointArray(@ClockData);
|
||||||
for Pos := 0 to HandPositions - 1 do
|
for Pos := 0 to HandPositions - 1 do
|
||||||
CircleTab^[Pos].Y := VertEquiv(CircleTab^[Pos].Y);
|
CircleTab^[Pos].Y := VertEquiv(CircleTab^[Pos].Y);
|
||||||
@ -673,7 +688,10 @@ var
|
|||||||
SaveBrush, SavePen: TColor;
|
SaveBrush, SavePen: TColor;
|
||||||
MinDots: Boolean;
|
MinDots: Boolean;
|
||||||
begin
|
begin
|
||||||
DotWidth := (MaxDotWidth * Longint(FClockRect.Right - FClockRect.Left)) div HRes;
|
if HRes<>0 then
|
||||||
|
DotWidth := (MaxDotWidth * Longint(FClockRect.Right - FClockRect.Left)) div HRes
|
||||||
|
else
|
||||||
|
DotWidth := (MaxDotWidth * Longint(FClockRect.Right - FClockRect.Left));
|
||||||
DotHeight := VertEquiv(DotWidth);
|
DotHeight := VertEquiv(DotWidth);
|
||||||
if DotHeight < MinDotHeight then DotHeight := MinDotHeight;
|
if DotHeight < MinDotHeight then DotHeight := MinDotHeight;
|
||||||
if DotWidth < MinDotWidth then DotWidth := MinDotWidth;
|
if DotWidth < MinDotWidth then DotWidth := MinDotWidth;
|
||||||
|
Reference in New Issue
Block a user