mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 13:39:11 +02:00
Qt: correct ExcludeClipRect
git-svn-id: trunk@12189 -
This commit is contained in:
parent
13c1fd094c
commit
767f96d04f
@ -1397,10 +1397,8 @@ function TQtWidgetSet.ExcludeClipRect(dc: hdc; Left, Top, Right, Bottom : Intege
|
|||||||
var
|
var
|
||||||
Region: QRegionH;
|
Region: QRegionH;
|
||||||
ExRegion: QRegionH;
|
ExRegion: QRegionH;
|
||||||
QtDC: TQtDeviceContext;
|
QtDC: TQtDeviceContext absolute dc;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
R1: PRect;
|
|
||||||
X1,Y1,X2,Y2: Integer;
|
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI ExcludeClipRect]');
|
WriteLn('[WinAPI ExcludeClipRect]');
|
||||||
@ -1410,23 +1408,13 @@ begin
|
|||||||
|
|
||||||
if not IsValidDC(DC) then Exit;
|
if not IsValidDC(DC) then Exit;
|
||||||
|
|
||||||
QtDC := TQtDeviceContext(DC);
|
ExRegion := QRegion_create(Left, Top, Right - Left, Bottom - Top, QRegionRectangle);
|
||||||
|
|
||||||
|
|
||||||
X1 := Left;
|
|
||||||
Y1 := Top;
|
|
||||||
X2 := Right;
|
|
||||||
Y2 := Bottom;
|
|
||||||
|
|
||||||
QMatrix_map(QPainter_worldMatrix(QtDC.Widget), X1, Y1, @X2, @Y2);
|
|
||||||
|
|
||||||
ExRegion := QRegion_create(X1, Y1, X2 - X1, Y2 - Y1, QRegionRectangle);
|
|
||||||
Region := QRegion_create;
|
Region := QRegion_create;
|
||||||
try
|
try
|
||||||
QPainter_clipRegion(QtDC.Widget, Region);
|
QPainter_clipRegion(QtDC.Widget, Region);
|
||||||
QRegion_subtract(Region, Region, ExRegion);
|
QRegion_subtract(Region, Region, ExRegion);
|
||||||
QtDC.setClipRegion(Region);
|
QtDC.setClipRegion(Region);
|
||||||
QPainter_setClipping(QtDC.Widget, True);
|
QtDC.setClipping(True);
|
||||||
|
|
||||||
if QRegion_isEmpty(Region)
|
if QRegion_isEmpty(Region)
|
||||||
then
|
then
|
||||||
@ -1434,14 +1422,11 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
QRegion_boundingRect(Region, @R);
|
QRegion_boundingRect(Region, @R);
|
||||||
New(R1);
|
if QRegion_contains(Region, PRect(@R))
|
||||||
R1^ := R;
|
|
||||||
if QRegion_contains(Region, R1)
|
|
||||||
then
|
then
|
||||||
Result := SIMPLEREGION
|
Result := SIMPLEREGION
|
||||||
else
|
else
|
||||||
RESULT := COMPLEXREGION;
|
Result := COMPLEXREGION;
|
||||||
Dispose(R1);
|
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
QRegion_destroy(Region);
|
QRegion_destroy(Region);
|
||||||
|
Loading…
Reference in New Issue
Block a user