Qt: fixed clipping in stretchDraw.issue #26004

git-svn-id: trunk@44693 -
This commit is contained in:
zeljko 2014-04-12 06:28:07 +00:00
parent 2da14ac740
commit fccbfe2973

View File

@ -6462,6 +6462,7 @@ var
dx, dy: integer; dx, dy: integer;
OldRop: Integer; OldRop: Integer;
OldBkColor: TColorRef; OldBkColor: TColorRef;
RestoreClip: Boolean;
begin begin
{$ifdef VerboseQtWinAPI} {$ifdef VerboseQtWinAPI}
WriteLn('[WinAPI StretchMaskBlt]', WriteLn('[WinAPI StretchMaskBlt]',
@ -6601,7 +6602,16 @@ begin
if Rop <> SRCCOPY then if Rop <> SRCCOPY then
DstQDC.Rop2 := Integer(Rop); DstQDC.Rop2 := Integer(Rop);
try try
RestoreClip := False;
if (SrcRect.Left < DstRect.Left) or (SrcRect.Top < DstRect.Top) and
DstQDC.getClipping and DstQDC.getClipRegion.containsRect(SrcRect) then
begin
RestoreClip := True;
DstQDC.setClipping(False);
end;
DstQDC.drawImage(@DstRect, Image, @SrcRect, QMask, @MaskRect); DstQDC.drawImage(@DstRect, Image, @SrcRect, QMask, @MaskRect);
if RestoreClip then
DstQDC.setClipping(True);
finally finally
if Rop <> SRCCOPY then if Rop <> SRCCOPY then
DstQDC.Rop2 := OldRop; DstQDC.Rop2 := OldRop;