mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 11:39:25 +02:00
cocoa: renagecheck errors in CGRectToRect and line drawing. Patch by C Western. #30874
git-svn-id: trunk@61073 -
This commit is contained in:
parent
df43305f89
commit
1bbba763bc
@ -2760,7 +2760,10 @@ begin
|
||||
CGContextSetLineDash(ADC.CGContext, 0, @ADashes[0], Length(ADashes));
|
||||
end;
|
||||
PS_USERSTYLE:
|
||||
CGContextSetLineDash(ADC.CGContext, 0, @Dashes[0], Length(Dashes));
|
||||
if Length(Dashes) > 0 then
|
||||
CGContextSetLineDash(ADC.CGContext, 0, @Dashes[0], Length(Dashes))
|
||||
else
|
||||
CGContextSetLineDash(ADC.CGContext, 0, nil, 0)
|
||||
else
|
||||
CGContextSetLineDash(ADC.CGContext, 0, nil, 0);
|
||||
end;
|
||||
|
@ -670,11 +670,17 @@ end;
|
||||
|
||||
function CGRectToRect(const c: CGRect): TRect;
|
||||
begin
|
||||
if CGRectIsEmpty(c) <> 0 then
|
||||
Result := Rect(0,0,0,0)
|
||||
else if CGRectIsInfinite(c) <> 0 then
|
||||
Result:= Rect(Low(Integer), Low(Integer), High(Integer), High(Integer))
|
||||
else begin
|
||||
Result.Left := Round(c.origin.x);
|
||||
Result.Top := Round(c.origin.y);
|
||||
Result.Right := Round(c.origin.x + c.size.width);
|
||||
Result.Bottom := Round(c.origin.y + c.size.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
function RectToNSRect(const r: TRect): NSRect;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user