mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 03:05:18 +08:00
Fixed: Fix issue where menu wouldn't show when text on bottom row of terminal was selected
Closes #2233
This commit is contained in:
@@ -183,14 +183,19 @@ public class TextSelectionCursorController implements CursorController {
|
|||||||
int y1 = Math.round((mSelY1 - 1 - terminalView.getTopRow()) * terminalView.mRenderer.getFontLineSpacing());
|
int y1 = Math.round((mSelY1 - 1 - terminalView.getTopRow()) * terminalView.mRenderer.getFontLineSpacing());
|
||||||
int y2 = Math.round((mSelY2 + 1 - terminalView.getTopRow()) * terminalView.mRenderer.getFontLineSpacing());
|
int y2 = Math.round((mSelY2 + 1 - terminalView.getTopRow()) * terminalView.mRenderer.getFontLineSpacing());
|
||||||
|
|
||||||
|
|
||||||
if (x1 > x2) {
|
if (x1 > x2) {
|
||||||
int tmp = x1;
|
int tmp = x1;
|
||||||
x1 = x2;
|
x1 = x2;
|
||||||
x2 = tmp;
|
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);
|
}, ActionMode.TYPE_FLOATING);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user