diff options
-rw-r--r-- | docview/components/richtext/RichTextDisplayUnit.pas | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/docview/components/richtext/RichTextDisplayUnit.pas b/docview/components/richtext/RichTextDisplayUnit.pas index 2e62a511..482a587b 100644 --- a/docview/components/richtext/RichTextDisplayUnit.pas +++ b/docview/components/richtext/RichTextDisplayUnit.pas @@ -231,10 +231,19 @@ ProfileEvent('DEBUG: DrawRichTextLine >>>'); BitmapRect.Bottom := Trunc(BitmapRect.Top + Bitmap.Height * Layout.VerticalImageScale); - FontManager.Canvas.StretchDraw(BitmapRect.Left, BitMapRect.Top, - BitmapRect.Right-BitMapRect.Left, BitMapRect.Bottom-BitMapRect.Top, Bitmap); - - inc( X, trunc( Bitmap.Width * Layout.HorizontalImageScale ) ); + if ((BitMapRect.Right - BitMapRect.Left) = Bitmap.Width) and + ((BitMapRect.Bottom - BitMapRect.Top) = Bitmap.Height) then + begin + // no stretching required + FontManager.Canvas.DrawImage(BitmapRect.Left, BitMapRect.Top, Bitmap); + inc(X, Bitmap.Width); + end + else + begin + FontManager.Canvas.StretchDraw(BitmapRect.Left, BitMapRect.Top, + BitmapRect.Right-BitMapRect.Left, BitMapRect.Bottom-BitMapRect.Top, Bitmap); + inc(X, trunc(Bitmap.Width * Layout.HorizontalImageScale)); + end; end; end else |