widget: use reliable text direction checks, not heuristics

This commit switches the way in which the editor and helper functions check
for RTL text from a heuristic to using the actual text direction.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2022-10-17 08:56:24 -04:00
committed by Elias Naur
parent bebc73db37
commit b46c0f5907
2 changed files with 1 additions and 8 deletions
-3
View File
@@ -794,9 +794,6 @@ func (e *Editor) PaintText(gtx layout.Context) {
start, end := clipLine(e.lines, e.Alignment, e.viewSize.X, cl, pos)
line := e.lines[start.lineCol.Y]
off := image.Point{X: start.x.Floor(), Y: start.y}.Sub(scroll)
if start.lineCol.X > end.lineCol.X {
start, end = end, start
}
l := subLayout(line, start, end)
t := op.Offset(off).Push(gtx.Ops)