Skip to content

Commit

Permalink
Fixed: Fix issue where menu wouldn't show when text on bottom row of …
Browse files Browse the repository at this point in the history
…terminal was selected

Closes #2233
  • Loading branch information
agnostic-apollo committed Jun 17, 2024
1 parent aee0da4 commit d24a04a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,19 @@ public void onGetContentRect(ActionMode mode, View view, Rect outRect) {
int y1 = Math.round((mSelY1 - 1 - terminalView.getTopRow()) * terminalView.mRenderer.getFontLineSpacing());
int y2 = Math.round((mSelY2 + 1 - terminalView.getTopRow()) * terminalView.mRenderer.getFontLineSpacing());


if (x1 > x2) {
int tmp = x1;
x1 = x2;
x2 = tmp;
}

outRect.set(x1, y1 + mHandleHeight, x2, y2 + mHandleHeight);
int terminalBottom = terminalView.getBottom();
int top = y1 + mHandleHeight;
int bottom = y2 + mHandleHeight;
if (top > terminalBottom) top = terminalBottom;
if (bottom > terminalBottom) bottom = terminalBottom;

outRect.set(x1, top, x2, bottom);
}
}, ActionMode.TYPE_FLOATING);
}
Expand Down

0 comments on commit d24a04a

Please sign in to comment.