gtk2: fix ETO_CLIPED flag

git-svn-id: trunk@38636 -
This commit is contained in:
paul 2012-09-13 07:18:34 +00:00
parent 11d68532cc
commit 8592fe793c
2 changed files with 6 additions and 41 deletions

View File

@ -3817,7 +3817,7 @@ var
LineStart, LineEnd, StrEnd: PChar;
Width, Height: Integer;
TopY, LineLen, LineHeight: Integer;
TopY, LineLen, LineHeight, SavedDC: Integer;
TxtPt: TPoint;
DCOrigin: TPoint;
Foreground, BackgroundColor: PGDKColor;
@ -3855,8 +3855,7 @@ begin
if DevCtx.GC <> nil then; // create GC
if ((Options and (ETO_OPAQUE+ETO_CLIPPED)) <> 0) and
(Rect=nil) then
if ((Options and (ETO_OPAQUE + ETO_CLIPPED)) <> 0) and (Rect = nil) then
begin
R := RectFromGdkRect(DevCtx.ClipRect);
OffsetRect(R, -R.Left, -R.Top);
@ -3873,10 +3872,8 @@ begin
if (Options and ETO_CLIPPED) <> 0 then
begin
X := Rect^.Left;
Y := Rect^.Top;
IntersectClipRect(DC, Rect^.Left, Rect^.Top,
Rect^.Right, Rect^.Bottom);
SavedDC := SaveDC(DC);
IntersectClipRect(DC, Rect^.Left, Rect^.Top, Rect^.Right, Rect^.Bottom);
end;
if DevCtx.HasTransf then
@ -3946,6 +3943,8 @@ begin
end;
end;
if (Options and ETO_CLIPPED) <> 0 then
RestoreDC(DC, SavedDC);
Result := True;
//DebugLn(Format('trace:< [TGtk2WidgetSet.ExtTextOut] DC:0x%x, X:%d, Y:%d, Options:%d, Str:''%s'', Count: %d', [DC, X, Y, Options, Str, Count]));
end;
@ -6470,39 +6469,6 @@ begin
end;
{------------------------------------------------------------------------------
Function: IntersectClipRect
Params: dc: hdc; Left, Top, Right, Bottom: Integer
Returns: Integer
Shrinks the clipping region in the device context dc to a region of all
intersecting points between the boundary defined by Left, Top, Right,
Bottom , and the Current clipping region.
The result can be one of the following constants
Error
NullRegion
SimpleRegion
ComplexRegion
------------------------------------------------------------------------------}
function TGtk2WidgetSet.IntersectClipRect(dc: hdc;
Left, Top, Right, Bottom: Integer): Integer;
var
DevCtx: TGtkDeviceContext absolute DC;
begin
if not IsValidDC(DC) then Exit;
if DevCtx.HasTransf then
begin
DevCtx.TransfRect(Left, Top, Right, Bottom);
DevCtx.TransfNormalize(Left, Right);
DevCtx.TransfNormalize(Top, Bottom);
end;
Result := inherited IntersectClipRect(DC, Left, Top, Right, Bottom);
end;
{------------------------------------------------------------------------------
Function: InvalidateRect
Params: aHandle:

View File

@ -157,7 +157,6 @@ function GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices : Longint;
Meshes: Pointer; NumMeshes : Longint; Mode : Longint): Boolean; override;
procedure InitializeCriticalSection(var CritSection: TCriticalSection); override;
function IntersectClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer; override;
function InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean) : Boolean; override;
function IsIconic(handle: HWND): boolean; override;
function IsWindow(handle: HWND): boolean; override;