mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 17:29:31 +02:00
carbon: fix improper pattern allocation, patch by Jonas Maebe
git-svn-id: trunk@25083 -
This commit is contained in:
parent
93136076b1
commit
008ae9167f
@ -1607,6 +1607,7 @@ var
|
|||||||
RGBA: array[0..3] of Single;
|
RGBA: array[0..3] of Single;
|
||||||
AROP2: Integer;
|
AROP2: Integer;
|
||||||
APatternSpace: CGColorSpaceRef;
|
APatternSpace: CGColorSpaceRef;
|
||||||
|
BaseSpace : CGColorSpaceRef;
|
||||||
begin
|
begin
|
||||||
if ADC = nil then Exit;
|
if ADC = nil then Exit;
|
||||||
if ADC.CGContext = nil then Exit;
|
if ADC.CGContext = nil then Exit;
|
||||||
@ -1625,11 +1626,17 @@ begin
|
|||||||
|
|
||||||
if FCGPattern <> nil then
|
if FCGPattern <> nil then
|
||||||
begin
|
begin
|
||||||
APatternSpace := CGColorSpaceCreatePattern(nil);
|
if not FColored then
|
||||||
|
BaseSpace:=CGColorSpaceCreateDeviceRGB
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
BaseSpace:=nil;
|
||||||
|
RGBA[0] := 1.0;
|
||||||
|
end;
|
||||||
|
APatternSpace := CGColorSpaceCreatePattern(BaseSpace);
|
||||||
CGContextSetFillColorSpace(ADC.CGContext, APatternSpace);
|
CGContextSetFillColorSpace(ADC.CGContext, APatternSpace);
|
||||||
CGColorSpaceRelease(APatternSpace);
|
CGColorSpaceRelease(APatternSpace);
|
||||||
if FColored then
|
if Assigned(BaseSpace) then CGColorSpaceRelease(BaseSpace);
|
||||||
RGBA[0] := 1.0;
|
|
||||||
CGContextSetFillPattern(ADC.CGcontext, FCGPattern, @RGBA[0]);
|
CGContextSetFillPattern(ADC.CGcontext, FCGPattern, @RGBA[0]);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user