mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 18:49:19 +02:00
carbon: fix carbon ExcludeClipRect for empty clip rect
git-svn-id: trunk@22551 -
This commit is contained in:
parent
e45d50c8c4
commit
7b3bf8124d
@ -797,6 +797,9 @@ end;
|
||||
function TCarbonRegion.CombineWith(ARegion: TCarbonRegion; CombineMode: Integer): Integer;
|
||||
var
|
||||
sh1, sh2: HIShapeRef;
|
||||
const
|
||||
MinCoord=-35000;
|
||||
MaxSize=65000;
|
||||
begin
|
||||
if not Assigned(ARegion) then
|
||||
Result := LCLType.Error
|
||||
@ -816,7 +819,15 @@ begin
|
||||
CFRelease(sh1); CFRelease(sh2);
|
||||
end;
|
||||
RGN_OR: Shape:=HIShapeCreateUnion(FShape, ARegion.Shape);
|
||||
RGN_DIFF: Shape:=HIShapeCreateDifference(FShape, ARegion.Shape);
|
||||
RGN_DIFF:
|
||||
begin
|
||||
if HIShapeIsEmpty(FShape) then
|
||||
{HIShapeCreateDifference doesn't work properly if original shape is empty}
|
||||
{to simulate "emptieness" very big shape is created }
|
||||
Shape:=HIShapeCreateWithRect(GetCGRect(MinCoord,MinCoord,MaxSize,MaxSize)); // create clip nothing.
|
||||
|
||||
Shape:=HIShapeCreateDifference(FShape, ARegion.Shape);
|
||||
end;
|
||||
RGN_COPY: Shape:=HIShapeCreateCopy(ARegion.Shape);
|
||||
else
|
||||
Result := LCLType.Error;
|
||||
|
Loading…
Reference in New Issue
Block a user