mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 01:28:19 +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;
|
||||
AROP2: Integer;
|
||||
APatternSpace: CGColorSpaceRef;
|
||||
BaseSpace : CGColorSpaceRef;
|
||||
begin
|
||||
if ADC = nil then Exit;
|
||||
if ADC.CGContext = nil then Exit;
|
||||
@ -1625,11 +1626,17 @@ begin
|
||||
|
||||
if FCGPattern <> nil then
|
||||
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);
|
||||
CGColorSpaceRelease(APatternSpace);
|
||||
if FColored then
|
||||
RGBA[0] := 1.0;
|
||||
if Assigned(BaseSpace) then CGColorSpaceRelease(BaseSpace);
|
||||
CGContextSetFillPattern(ADC.CGcontext, FCGPattern, @RGBA[0]);
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user