Qt5: fix mask size if exceeds destination pixmap

git-svn-id: trunk@62913 -
This commit is contained in:
zeljko 2020-04-08 12:11:47 +00:00
parent bb082ce6f3
commit 274cab383e

View File

@ -6821,9 +6821,15 @@ var
AMaskPix := QPixmap_create();
QPixmap_fromImage(AMaskPix, AMaskImg);
try
if IsRectEmpty(MaskRect) or (MaskRect.Size <> DstRect.Size) then
QPixmap_scaled(AMaskPix, AScaledPix, Width, Height)
else
begin
if (QPixmap_width(ATempPixmap) < (DstRect.Right - DstRect.Left)) or
(QPixmap_Height(ATempPixmap) < (DstRect.Bottom - DstRect.Top)) then
QPixmap_scaled(AMaskPix, AScaledPix, QPixmap_width(ATempPixmap), QPixmap_height(ATempPixmap))
else
QPixmap_scaled(AMaskPix, AScaledPix, Width, Height);
end else
QPixmap_copy(AMaskPix, AScaledPix, MaskRect.Left, MaskRect.Top,
MaskRect.Right - MaskRect.Left, MaskRect.Bottom - MaskRect.Top);