mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 11:58:12 +02:00
LCL TImageList: ignore out of range index when drawing, fixes #0012130: Mac OS X : TreeView1CustomDrawItem AV
git-svn-id: trunk@16576 -
This commit is contained in:
parent
6909aaac4c
commit
b333c7d0f5
@ -468,7 +468,7 @@ end;
|
||||
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
||||
ADrawEffect: TGraphicsDrawEffect);
|
||||
begin
|
||||
if (FCount = 0) or (AIndex >= FCount) then Exit;
|
||||
if (AIndex < 0) or (AIndex >= FCount) then Exit;
|
||||
|
||||
ReferenceNeeded;
|
||||
TWSCustomImageListClass(WidgetSetClass).Draw(Self, AIndex, ACanvas, Rect(AX, AY, FWidth, FHeight),
|
||||
|
@ -105,6 +105,7 @@ var
|
||||
ListImg, DeviceImg: TLazIntfImage;
|
||||
ImgHandle, MskHandle: HBitmap;
|
||||
begin
|
||||
if (AIndex < 0) or (AIndex >= Count) then Exit;
|
||||
if ADrawEffect = gdeNormal then
|
||||
begin
|
||||
ABitmap := TBitmap(Items[AIndex]);
|
||||
|
Loading…
Reference in New Issue
Block a user