mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 14:39:20 +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,13 +797,16 @@ end;
|
|||||||
function TCarbonRegion.CombineWith(ARegion: TCarbonRegion; CombineMode: Integer): Integer;
|
function TCarbonRegion.CombineWith(ARegion: TCarbonRegion; CombineMode: Integer): Integer;
|
||||||
var
|
var
|
||||||
sh1, sh2: HIShapeRef;
|
sh1, sh2: HIShapeRef;
|
||||||
|
const
|
||||||
|
MinCoord=-35000;
|
||||||
|
MaxSize=65000;
|
||||||
begin
|
begin
|
||||||
if not Assigned(ARegion) then
|
if not Assigned(ARegion) then
|
||||||
Result := LCLType.Error
|
Result := LCLType.Error
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Result := LCLType.ComplexRegion;
|
Result := LCLType.ComplexRegion;
|
||||||
if (CombineMode in [RGN_AND, RGN_OR, RGN_XOR]) and HIShapeIsEmpty(FShape) then
|
if (CombineMode in [RGN_AND, RGN_OR, RGN_XOR]) and HIShapeIsEmpty(FShape) then
|
||||||
CombineMode := RGN_COPY;
|
CombineMode := RGN_COPY;
|
||||||
|
|
||||||
case CombineMode of
|
case CombineMode of
|
||||||
@ -816,7 +819,15 @@ begin
|
|||||||
CFRelease(sh1); CFRelease(sh2);
|
CFRelease(sh1); CFRelease(sh2);
|
||||||
end;
|
end;
|
||||||
RGN_OR: Shape:=HIShapeCreateUnion(FShape, ARegion.Shape);
|
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);
|
RGN_COPY: Shape:=HIShapeCreateCopy(ARegion.Shape);
|
||||||
else
|
else
|
||||||
Result := LCLType.Error;
|
Result := LCLType.Error;
|
||||||
|
Loading…
Reference in New Issue
Block a user