LCL: Correction for RectInRegion in GTK/GTK2 bindings. Issue #23239

git-svn-id: trunk@39223 -
This commit is contained in:
juha 2012-11-01 19:35:52 +00:00
parent edbe2280e7
commit b36cc487aa
2 changed files with 22 additions and 4 deletions

View File

@ -7586,7 +7586,16 @@ begin
//DebugLn(Format('trace:< [TGtkWidgetSet.Rectangle] DC:0x%x, X1:%d, Y1:%d, X2:%d, Y2:%d', [DC, X1, Y1, X2, Y2]));
end;
// Determines if the specified rectangle is within the boundaries of a region.
{------------------------------------------------------------------------------
Function: RectInRegion
Params: RGN: HRGN; ARect: TRect
Returns: True if any part of the specified rectangle lies within the
boundaries of the region.
Determines whether any part of the specified rectangle is within the boundaries
of a region.
------------------------------------------------------------------------------}
function TGtkWidgetSet.RectInRegion(RGN: HRGN; ARect: TRect): Boolean;
var
AGdkRect: TGdkRectangle;
@ -7594,7 +7603,7 @@ begin
//todo: sanity checks for valid handle etc.
AGdkRect := GdkRectFromRect(ARect);
Result := gdk_region_rect_in({%H-}PGdiObject(RGN)^.GDIRegionObject, @AGdkRect)
= GDK_OVERLAP_RECTANGLE_IN;
<> GDK_OVERLAP_RECTANGLE_OUT;
end;
{------------------------------------------------------------------------------

View File

@ -7055,7 +7055,16 @@ begin
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end;
// Determines if the specified rectangle is within the boundaries of a region.
{------------------------------------------------------------------------------
Function: RectInRegion
Params: RGN: HRGN; ARect: TRect
Returns: True if any part of the specified rectangle lies within the
boundaries of the region.
Determines whether any part of the specified rectangle is within the boundaries
of a region.
------------------------------------------------------------------------------}
function TGtk2WidgetSet.RectInRegion(RGN: HRGN; ARect: TRect): Boolean;
var
AGdkRect: TGdkRectangle;
@ -7063,7 +7072,7 @@ begin
//todo: sanity checks for valid handle etc.
AGdkRect := GdkRectFromRect(ARect);
Result := gdk_region_rect_in({%H-}PGdiObject(RGN)^.GDIRegionObject, @AGdkRect)
= GDK_OVERLAP_RECTANGLE_IN;
<> GDK_OVERLAP_RECTANGLE_OUT;
end;
{------------------------------------------------------------------------------