mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 20:20:36 +02:00
gtk2: fix ETO_CLIPED flag
git-svn-id: trunk@38636 -
This commit is contained in:
parent
11d68532cc
commit
8592fe793c
@ -3817,7 +3817,7 @@ var
|
|||||||
|
|
||||||
LineStart, LineEnd, StrEnd: PChar;
|
LineStart, LineEnd, StrEnd: PChar;
|
||||||
Width, Height: Integer;
|
Width, Height: Integer;
|
||||||
TopY, LineLen, LineHeight: Integer;
|
TopY, LineLen, LineHeight, SavedDC: Integer;
|
||||||
TxtPt: TPoint;
|
TxtPt: TPoint;
|
||||||
DCOrigin: TPoint;
|
DCOrigin: TPoint;
|
||||||
Foreground, BackgroundColor: PGDKColor;
|
Foreground, BackgroundColor: PGDKColor;
|
||||||
@ -3855,8 +3855,7 @@ begin
|
|||||||
|
|
||||||
if DevCtx.GC <> nil then; // create GC
|
if DevCtx.GC <> nil then; // create GC
|
||||||
|
|
||||||
if ((Options and (ETO_OPAQUE+ETO_CLIPPED)) <> 0) and
|
if ((Options and (ETO_OPAQUE + ETO_CLIPPED)) <> 0) and (Rect = nil) then
|
||||||
(Rect=nil) then
|
|
||||||
begin
|
begin
|
||||||
R := RectFromGdkRect(DevCtx.ClipRect);
|
R := RectFromGdkRect(DevCtx.ClipRect);
|
||||||
OffsetRect(R, -R.Left, -R.Top);
|
OffsetRect(R, -R.Left, -R.Top);
|
||||||
@ -3873,10 +3872,8 @@ begin
|
|||||||
|
|
||||||
if (Options and ETO_CLIPPED) <> 0 then
|
if (Options and ETO_CLIPPED) <> 0 then
|
||||||
begin
|
begin
|
||||||
X := Rect^.Left;
|
SavedDC := SaveDC(DC);
|
||||||
Y := Rect^.Top;
|
IntersectClipRect(DC, Rect^.Left, Rect^.Top, Rect^.Right, Rect^.Bottom);
|
||||||
IntersectClipRect(DC, Rect^.Left, Rect^.Top,
|
|
||||||
Rect^.Right, Rect^.Bottom);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if DevCtx.HasTransf then
|
if DevCtx.HasTransf then
|
||||||
@ -3946,6 +3943,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if (Options and ETO_CLIPPED) <> 0 then
|
||||||
|
RestoreDC(DC, SavedDC);
|
||||||
Result := True;
|
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]));
|
//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;
|
end;
|
||||||
@ -6470,39 +6469,6 @@ begin
|
|||||||
|
|
||||||
end;
|
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
|
Function: InvalidateRect
|
||||||
Params: aHandle:
|
Params: aHandle:
|
||||||
|
@ -157,7 +157,6 @@ function GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices : Longint;
|
|||||||
Meshes: Pointer; NumMeshes : Longint; Mode : Longint): Boolean; override;
|
Meshes: Pointer; NumMeshes : Longint; Mode : Longint): Boolean; override;
|
||||||
|
|
||||||
procedure InitializeCriticalSection(var CritSection: TCriticalSection); 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 InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean) : Boolean; override;
|
||||||
function IsIconic(handle: HWND): boolean; override;
|
function IsIconic(handle: HWND): boolean; override;
|
||||||
function IsWindow(handle: HWND): boolean; override;
|
function IsWindow(handle: HWND): boolean; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user