Qt: fix scaled mask size if mask size is bigger than pixmap to be masked.

git-svn-id: trunk@62912 -
This commit is contained in:
zeljko 2020-04-08 10:59:34 +00:00
parent 9786f79240
commit bb082ce6f3

View File

@ -6881,12 +6881,18 @@ 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
begin
QPixmap_copy(AMaskPix, AScaledPix, MaskRect.Left, MaskRect.Top,
MaskRect.Right - MaskRect.Left, MaskRect.Bottom - MaskRect.Top);
end;
ABitmap := QBitmap_Create(AScaledPix);