mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:19:17 +02:00
carbon: support for R2_NOTXORPEN flag, used by synedit to draw a caret
git-svn-id: trunk@55532 -
This commit is contained in:
parent
090c69df0e
commit
c4c7fec236
@ -1728,7 +1728,7 @@ begin
|
|||||||
AB := 1;
|
AB := 1;
|
||||||
AA := 0;
|
AA := 0;
|
||||||
end;
|
end;
|
||||||
R2_NOT:
|
R2_NOT, R2_NOTXORPEN:
|
||||||
begin
|
begin
|
||||||
AR := 1;
|
AR := 1;
|
||||||
AG := 1;
|
AG := 1;
|
||||||
@ -1892,17 +1892,18 @@ begin
|
|||||||
if ADC = nil then Exit;
|
if ADC = nil then Exit;
|
||||||
if ADC.CGContext = nil then Exit;
|
if ADC.CGContext = nil then Exit;
|
||||||
|
|
||||||
if UseROP2 then
|
if UseROP2 then
|
||||||
AROP2 := (ADC as TCarbonDeviceContext).ROP2
|
AROP2 := (ADC as TCarbonDeviceContext).ROP2
|
||||||
else
|
else
|
||||||
AROP2 := R2_COPYPEN;
|
AROP2 := R2_COPYPEN;
|
||||||
|
|
||||||
GetRGBA(AROP2, RGBA[0], RGBA[1], RGBA[2], RGBA[3]);
|
GetRGBA(AROP2, RGBA[0], RGBA[1], RGBA[2], RGBA[3]);
|
||||||
|
|
||||||
if AROP2 <> R2_NOT then
|
// Blend Mode is set via TCarbonPen.Apply()
|
||||||
CGContextSetBlendMode(ADC.CGContext, kCGBlendModeNormal)
|
//if AROP2 <> R2_NOT then
|
||||||
else
|
// CGContextSetBlendMode(ADC.CGContext, kCGBlendModeNormal)
|
||||||
CGContextSetBlendMode(ADC.CGContext, kCGBlendModeDifference);
|
//else
|
||||||
|
// CGContextSetBlendMode(ADC.CGContext, kCGBlendModeDifference);
|
||||||
|
|
||||||
if FCGPattern <> nil then
|
if FCGPattern <> nil then
|
||||||
begin
|
begin
|
||||||
@ -2034,6 +2035,7 @@ var
|
|||||||
AR, AG, AB, AA: Single;
|
AR, AG, AB, AA: Single;
|
||||||
AROP2: Integer;
|
AROP2: Integer;
|
||||||
ADashes: TCarbonDashes;
|
ADashes: TCarbonDashes;
|
||||||
|
blendmode: CGBlendMode;
|
||||||
begin
|
begin
|
||||||
if ADC = nil then Exit;
|
if ADC = nil then Exit;
|
||||||
if ADC.CGContext = nil then Exit;
|
if ADC.CGContext = nil then Exit;
|
||||||
@ -2043,10 +2045,13 @@ begin
|
|||||||
|
|
||||||
GetRGBA(AROP2, AR, AG, AB, AA);
|
GetRGBA(AROP2, AR, AG, AB, AA);
|
||||||
|
|
||||||
if AROP2 <> R2_NOT then
|
case AROP2 of
|
||||||
CGContextSetBlendMode(ADC.CGContext, kCGBlendModeNormal)
|
R2_NOT: blendmode := kCGBlendModeDifference;
|
||||||
|
R2_NOTXORPEN: blendmode := kCGBlendModeDifference;
|
||||||
else
|
else
|
||||||
CGContextSetBlendMode(ADC.CGContext, kCGBlendModeDifference);
|
blendmode := kCGBlendModeNormal;
|
||||||
|
end;
|
||||||
|
CGContextSetBlendMode(ADC.CGContext, blendmode);
|
||||||
|
|
||||||
CGContextSetRGBStrokeColor(ADC.CGContext, AR, AG, AB, AA);
|
CGContextSetRGBStrokeColor(ADC.CGContext, AR, AG, AB, AA);
|
||||||
CGContextSetLineWidth(ADC.CGContext, FWidth);
|
CGContextSetLineWidth(ADC.CGContext, FWidth);
|
||||||
|
Loading…
Reference in New Issue
Block a user