Skip to content

Commit 73ea9ec

Browse files
committed
Fixed mouse click issue
1 parent fe98ce6 commit 73ea9ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Terminal.Gui/Views/HexView.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ protected internal override bool OnMouseEvent (MouseEvent me)
349349

350350
if (me.Flags == MouseFlags.WheeledDown)
351351
{
352-
DisplayStart = Math.Min (DisplayStart + BytesPerLine, _source.Length);
352+
DisplayStart = Math.Min (DisplayStart + BytesPerLine, GetEditedSize());
353353

354354
return true;
355355
}
@@ -392,11 +392,11 @@ protected internal override bool OnMouseEvent (MouseEvent me)
392392

393393
if (clickIsOnLeftSide)
394394
{
395-
Address = Math.Min (lineStart + me.Position.X - blocksRightOffset, _source.Length - 1);
395+
Address = Math.Min (lineStart + me.Position.X - blocksRightOffset, GetEditedSize ());
396396
}
397397
else
398398
{
399-
Address = Math.Min (lineStart + item, _source.Length - 1);
399+
Address = Math.Min (lineStart + item, GetEditedSize ());
400400
}
401401

402402
if (me.Flags == MouseFlags.Button1DoubleClicked)

0 commit comments

Comments
 (0)