Fix ExtTextOut function - added ignoring device context BkMode

git-svn-id: trunk@19238 -
This commit is contained in:
dmitry 2009-04-06 07:57:49 +00:00
parent 8636b8453a
commit 78549425be
2 changed files with 12 additions and 2 deletions

View File

@ -819,6 +819,7 @@ function TCarbonDeviceContext.ExtTextOut(X, Y: Integer; Options: Longint;
Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;
var
TextLayout: TCarbonTextLayout;
BrushSolid: Boolean;
begin
Result := False;
//DebugLn('TCarbonDeviceContext.ExtTextOut ' + DbgS(X) + ', ' + DbgS(Y) + ' R: ' + DbgS(Rect^) +
@ -827,7 +828,13 @@ begin
if Rect <> nil then
begin
// fill background
if (Options and ETO_OPAQUE) > 0 then FillRect(Rect^, BkBrush);
if (Options and ETO_OPAQUE) > 0 then
begin
BrushSolid := BkBrush.Solid; // must ignore BkMode
BkBrush.Solid := True;
FillRect(Rect^, BkBrush);
BkBrush.Solid := BrushSolid;
end;
//DebugLn('TCarbonDeviceContext.ExtTextOut fill ' + DbgS(Rect^));
end;
@ -838,8 +845,11 @@ begin
// fill drawed text background
if (Rect = nil) and ((Options and ETO_OPAQUE) > 0) then
begin
BrushSolid := BkBrush.Solid; // must ignore BkMode
BkBrush.Solid := True;
BkBrush.Apply(Self, False); // do not use ROP2
CGContextFillRect(CGContext, TextLayout.GetDrawBounds(X, Y));
BkBrush.Solid := BrushSolid;
end;
end;

View File

@ -165,7 +165,7 @@ type
procedure GetRGBA(AROP2: Integer; out AR, AG, AB, AA: Single);
function CreateCGColor: CGColorRef;
property Solid: Boolean read FA;
property Solid: Boolean read FA write FA;
property ColorRef: TColorRef read GetColorRef;
end;