Skip to content

Commit e9bcb16

Browse files
Partial refactor of the mess that is TerminalView
- Decouple the `CursorController`, `TextSelectionCursorController`(previously `SelectionModifierCursorController`) and `TextSelectionHandleView` (previously `HandleView`) from `TerminalView` by moving them to their own class files. - Fixes termux#1501 which caused the `java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.` exception to be thrown when long pressing the down key while simultaneously long pressing the terminal view for text selection.
1 parent 90bc91a commit e9bcb16

File tree

5 files changed

+954
-757
lines changed

5 files changed

+954
-757
lines changed

terminal-view/src/main/java/com/termux/view/TerminalRenderer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,12 @@ private void drawTextRun(Canvas canvas, char[] text, int[] palette, float y, int
230230

231231
if (savedMatrix) canvas.restore();
232232
}
233+
234+
public float getFontWidth() {
235+
return mFontWidth;
236+
}
237+
238+
public int getFontLineSpacing() {
239+
return mFontLineSpacing;
240+
}
233241
}

0 commit comments

Comments
 (0)