mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:39:19 +02:00
Carbon intf: fixed invalid CGRect conversion with help from Tobias Giesen
git-svn-id: trunk@11968 -
This commit is contained in:
parent
5a58ffb486
commit
5efbc8540f
@ -1,4 +1,4 @@
|
|||||||
The following people contributed to Lazarus:
|
The following people contributed to Lazarus:
|
||||||
|
|
||||||
A. J. Venter
|
A. J. Venter
|
||||||
Aleksey Lagunov
|
Aleksey Lagunov
|
||||||
@ -93,6 +93,7 @@ Sergio Marcelo
|
|||||||
Shane Miller
|
Shane Miller
|
||||||
Stefan Hille
|
Stefan Hille
|
||||||
Taras Boychuk
|
Taras Boychuk
|
||||||
|
Tobias Giesen
|
||||||
Tomas Gregorovic
|
Tomas Gregorovic
|
||||||
Tom Lisjac
|
Tom Lisjac
|
||||||
Tony Maro
|
Tony Maro
|
||||||
|
@ -712,10 +712,20 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function CGRectToRect(const ARect: CGRect): TRect;
|
function CGRectToRect(const ARect: CGRect): TRect;
|
||||||
begin
|
begin
|
||||||
Result.Left := Floor(ARect.origin.x);
|
if CGRectIsNull(ARect) <> 0 then
|
||||||
Result.Top := Floor(ARect.origin.y);
|
begin // CGRect passed is invalid!
|
||||||
Result.Right := Ceil(ARect.origin.x + ARect.size.width);
|
Result.Left := 0;
|
||||||
Result.Bottom := Ceil(ARect.origin.y + ARect.size.height);
|
Result.Top := 0;
|
||||||
|
Result.Right := 0;
|
||||||
|
Result.Bottom := 0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Result.Left := Floor(ARect.origin.x);
|
||||||
|
Result.Top := Floor(ARect.origin.y);
|
||||||
|
Result.Right := Ceil(ARect.origin.x + ARect.size.width);
|
||||||
|
Result.Bottom := Ceil(ARect.origin.y + ARect.size.height);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -751,10 +761,20 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function HIRectToCarbonRect(const ARect: HIRect): FPCMacOSAll.Rect;
|
function HIRectToCarbonRect(const ARect: HIRect): FPCMacOSAll.Rect;
|
||||||
begin
|
begin
|
||||||
Result.Left := Floor(ARect.origin.x);
|
if CGRectIsNull(ARect) <> 0 then
|
||||||
Result.Top := Floor(ARect.origin.y);
|
begin // CGRect passed is invalid!
|
||||||
Result.Right := Ceil(ARect.origin.x + ARect.size.width);
|
Result.Left := 0;
|
||||||
Result.Bottom := Ceil(ARect.origin.y + ARect.size.height);
|
Result.Top := 0;
|
||||||
|
Result.Right := 0;
|
||||||
|
Result.Bottom := 0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Result.Left := Floor(ARect.origin.x);
|
||||||
|
Result.Top := Floor(ARect.origin.y);
|
||||||
|
Result.Right := Ceil(ARect.origin.x + ARect.size.width);
|
||||||
|
Result.Bottom := Ceil(ARect.origin.y + ARect.size.height);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user