소스 검색

scaling option for SVG align mode

Johann ELSASS 5 년 전
부모
커밋
a6676533b0
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      bcsvgviewer.pas

+ 6 - 1
bcsvgviewer.pas

@@ -337,7 +337,12 @@ begin
 
   ratioX := BitmapWidth / FSVG.WidthAsPixel;
   ratioY := BitmapHeight / FSVG.HeightAsPixel;
-  ratio := min(ratioX, ratioY);
+  if StretchMode = smStretch then
+    ratio := min(ratioX, ratioY)
+  else if StretchMode = smShrink then
+    ratio := min(1, min(ratioX, ratioY))
+  else
+    ratio := 1;
   result := RectWithSizeF(0, 0, FSVG.WidthAsPixel * ratio,
               FSVG.HeightAsPixel * ratio);
   result.Offset((BitmapWidth - result.Width) / 2,