mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 01:59:34 +02:00
lcl: grids: fix ranges in GetPxTopLeft. Issue #30184
git-svn-id: trunk@52390 -
This commit is contained in:
parent
55188988d4
commit
8999b027ad
@ -2411,14 +2411,14 @@ end;
|
||||
|
||||
function TCustomGrid.GetPxTopLeft: TPoint;
|
||||
begin
|
||||
if FTopLeft.x < FGCache.AccumWidth.Count then
|
||||
if (FTopLeft.x >= 0) and (FTopLeft.x < FGCache.AccumWidth.Count) then
|
||||
Result.x := Integer(PtrUInt(FGCache.AccumWidth[FTopLeft.x]))+FGCache.TLColOff-FGCache.FixedWidth
|
||||
else if FTopLeft.x > 0 then
|
||||
Result.x := FGCache.GridWidth+FGCache.TLColOff-FGCache.FixedWidth
|
||||
else
|
||||
Result.x := 0;
|
||||
|
||||
if FTopLeft.y < FGCache.AccumHeight.Count then
|
||||
if (FTopLeft.y >= 0) and (FTopLeft.y < FGCache.AccumHeight.Count) then
|
||||
Result.y := Integer(PtrUInt(FGCache.AccumHeight[FTopLeft.y]))+FGCache.TLRowOff-FGCache.FixedHeight
|
||||
else if FTopLeft.y > 0 then
|
||||
Result.y := FGCache.GridHeight+FGCache.TLRowOff-FGCache.FixedHeight
|
||||
|
Loading…
Reference in New Issue
Block a user