fpspreadsheet: Improved painting of embedded images in worksheetgrid in case of scaling factor 1.0

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8329 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-06-26 17:39:07 +00:00
parent 93b4393d86
commit e8d8973789

View File

@ -3041,6 +3041,9 @@ begin
SelectClipRgn(Canvas.Handle, rgn);
R := Rect(0, 0, w, h);
OffsetRect(R, imgRect.Left, imgRect.Top);
if (img^.ScaleX = 1.0) and (img^.ScaleY = 1.0) then
Canvas.Draw(R.Left, R.Top, TPicture(img^.Picture).Graphic)
else
Canvas.StretchDraw(R, TPicture(img^.Picture).Graphic);
finally
DeleteObject(rgn);