|
@@ -288,10 +288,10 @@ begin
|
|
|
vbSize.x := vbSize.x * (dpi / FSVG.Units.DpiX);
|
|
vbSize.x := vbSize.x * (dpi / FSVG.Units.DpiX);
|
|
|
vbSize.y := vbSize.y * (dpi / FSVG.Units.DpiY);
|
|
vbSize.y := vbSize.y * (dpi / FSVG.Units.DpiY);
|
|
|
if ((StretchMode = smShrink) and ((vbSize.x > w + 0.1) or (vbSize.y > h + 0.1))) or
|
|
if ((StretchMode = smShrink) and ((vbSize.x > w + 0.1) or (vbSize.y > h + 0.1))) or
|
|
|
- (StretchMode = smStretch) then
|
|
|
|
|
|
|
+ (StretchMode in[smStretch, smCover]) then
|
|
|
begin
|
|
begin
|
|
|
if Proportional then
|
|
if Proportional then
|
|
|
- Result := FSVG.GetStretchRectF(HorizAlign, VertAlign, 0, 0, w, h)
|
|
|
|
|
|
|
+ Result := FSVG.GetStretchRectF(HorizAlign, VertAlign, 0, 0, w, h, StretchMode = smCover)
|
|
|
else
|
|
else
|
|
|
if StretchMode = smShrink then
|
|
if StretchMode = smShrink then
|
|
|
begin
|
|
begin
|
|
@@ -337,12 +337,13 @@ begin
|
|
|
|
|
|
|
|
ratioX := BitmapWidth / FSVG.WidthAsPixel;
|
|
ratioX := BitmapWidth / FSVG.WidthAsPixel;
|
|
|
ratioY := BitmapHeight / FSVG.HeightAsPixel;
|
|
ratioY := BitmapHeight / FSVG.HeightAsPixel;
|
|
|
- if StretchMode = smStretch then
|
|
|
|
|
- ratio := min(ratioX, ratioY)
|
|
|
|
|
- else if StretchMode = smShrink then
|
|
|
|
|
- ratio := min(1, min(ratioX, ratioY))
|
|
|
|
|
|
|
+ case StretchMode of
|
|
|
|
|
+ smStretch: ratio := min(ratioX, ratioY);
|
|
|
|
|
+ smShrink: ratio := min(1, min(ratioX, ratioY));
|
|
|
|
|
+ smCover: ratio := max(ratioX, ratioY);
|
|
|
else
|
|
else
|
|
|
ratio := 1;
|
|
ratio := 1;
|
|
|
|
|
+ end;
|
|
|
result := RectWithSizeF(0, 0, FSVG.WidthAsPixel * ratio,
|
|
result := RectWithSizeF(0, 0, FSVG.WidthAsPixel * ratio,
|
|
|
FSVG.HeightAsPixel * ratio);
|
|
FSVG.HeightAsPixel * ratio);
|
|
|
result.Offset((BitmapWidth - result.Width) / 2,
|
|
result.Offset((BitmapWidth - result.Width) / 2,
|