mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
lcl: imglist: fix division by 0 when Width=0. Issue #33679
git-svn-id: trunk@57775 -
This commit is contained in:
parent
de9e83e33c
commit
8497244873
@ -1162,7 +1162,10 @@ begin
|
||||
FList.Insert(I, Result);
|
||||
Result.FImageList := FImageList;
|
||||
Result.FWidth := AImageWidth;
|
||||
Result.FHeight := FImageList.Height * AImageWidth div FImageList.Width;
|
||||
if FImageList.Width<>0 then
|
||||
Result.FHeight := FImageList.Height * AImageWidth div FImageList.Width
|
||||
else
|
||||
Result.FHeight := 0;
|
||||
Result.FAutoCreatedInDesignTime := AutoCreatedInDesignTime and (AImageWidth<>FImageList.Width);
|
||||
if AScaleFromExisting then
|
||||
begin
|
||||
@ -1806,7 +1809,12 @@ begin
|
||||
if FData.Find(AImageWidth, I) then
|
||||
Result := FData[I].Height
|
||||
else
|
||||
Result := AImageWidth * FHeight div FWidth;
|
||||
begin
|
||||
if FWidth<>0 then
|
||||
Result := AImageWidth * FHeight div FWidth
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.GetIcon(Index: Integer; Image: TIcon; AEffect: TGraphicsDrawEffect);
|
||||
|
Loading…
Reference in New Issue
Block a user