mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
widget: remove unneeded editor flicker logic
We cannot find a way to trigger this flickering condition anymore, and so we're removing the logic guarding against it. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -889,17 +889,6 @@ func (e *Editor) layoutText(s text.Shaper) ([]text.Line, layout.Dimensions) {
|
|||||||
lines, _ = nullLayout(r)
|
lines, _ = nullLayout(r)
|
||||||
}
|
}
|
||||||
dims := linesDimens(lines)
|
dims := linesDimens(lines)
|
||||||
for i := 0; i < len(lines)-1; i++ {
|
|
||||||
// To avoid layout flickering while editing, assume a soft newline takes
|
|
||||||
// up all available space.
|
|
||||||
if layout := lines[i].Layout; len(layout.Text) > 0 {
|
|
||||||
r := layout.Text[len(layout.Text)-1]
|
|
||||||
if r != '\n' {
|
|
||||||
dims.Size.X = e.maxWidth
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return lines, dims
|
return lines, dims
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user