mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 18:59:21 +02:00
lazreport: fix off by one error in calculation of PictureView size. This avoids unnecessary stretch whew pictureview size = image size
git-svn-id: trunk@39365 -
This commit is contained in:
parent
115192fcce
commit
8d49c04d1f
@ -4414,8 +4414,8 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
BeginDraw(aCanvas);
|
BeginDraw(aCanvas);
|
||||||
CalcGaps;
|
CalcGaps;
|
||||||
w := DRect.Right - DRect.Left;
|
w := DRect.Right - DRect.Left - 1;
|
||||||
h := DRect.Bottom - DRect.Top;
|
h := DRect.Bottom - DRect.Top - 1;
|
||||||
with aCanvas do
|
with aCanvas do
|
||||||
begin
|
begin
|
||||||
ShowBackground;
|
ShowBackground;
|
||||||
@ -4430,19 +4430,19 @@ begin
|
|||||||
end
|
end
|
||||||
else if not ((Picture.Graphic = nil) or Picture.Graphic.Empty) then
|
else if not ((Picture.Graphic = nil) or Picture.Graphic.Empty) then
|
||||||
begin
|
begin
|
||||||
|
r := DRect;
|
||||||
|
Dec(r.Bottom);
|
||||||
|
Dec(r.Right);
|
||||||
if (Flags and flStretched) <> 0 then
|
if (Flags and flStretched) <> 0 then
|
||||||
begin
|
begin
|
||||||
r := DRect;
|
|
||||||
if (Flags and flPictRatio) <> 0 then
|
if (Flags and flPictRatio) <> 0 then
|
||||||
begin
|
begin
|
||||||
kx := dx / Picture.Width;
|
kx := dx / Picture.Width;
|
||||||
ky := dy / Picture.Height;
|
ky := dy / Picture.Height;
|
||||||
if kx < ky then
|
if kx < ky then
|
||||||
r := Rect(DRect.Left, DRect.Top,
|
r.Bottom := r.Top + Round(Picture.Height * kx)
|
||||||
DRect.Right, DRect.Top + Round(Picture.Height * kx))
|
|
||||||
else
|
else
|
||||||
r := Rect(DRect.Left, DRect.Top,
|
r.Right := r.Left + Round(Picture.Width * ky);
|
||||||
DRect.Left + Round(Picture.Width * ky), DRect.Bottom);
|
|
||||||
w1 := r.Right - r.Left;
|
w1 := r.Right - r.Left;
|
||||||
h1 := r.Bottom - r.Top;
|
h1 := r.Bottom - r.Top;
|
||||||
if (Flags and flPictCenter) <> 0 then
|
if (Flags and flPictCenter) <> 0 then
|
||||||
@ -4456,7 +4456,6 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
r := DRect;
|
|
||||||
if (Flags and flPictCenter) <> 0 then
|
if (Flags and flPictCenter) <> 0 then
|
||||||
OffsetRect(r, (w - Picture.Width) div 2, (h - Picture.Height) div 2);
|
OffsetRect(r, (w - Picture.Width) div 2, (h - Picture.Height) div 2);
|
||||||
ClipNeeded := (Picture.Height > h) or (Picture.Width > w);
|
ClipNeeded := (Picture.Height > h) or (Picture.Width > w);
|
||||||
|
Loading…
Reference in New Issue
Block a user