diff options
author | 2023-09-12 18:27:30 +0200 | |
---|---|---|
committer | 2023-09-12 18:27:30 +0200 | |
commit | 4389ab9865d13e17ce3c66223d7c149437be692b (patch) | |
tree | ed27519df0e5dfce1ef1a13bfa30bc50efe2e2d3 /graphics | |
parent | abab1448576fbfa4717b65cdf1455debf44f2df5 (diff) | |
download | iced-4389ab9865d13e17ce3c66223d7c149437be692b.tar.gz iced-4389ab9865d13e17ce3c66223d7c149437be692b.tar.bz2 iced-4389ab9865d13e17ce3c66223d7c149437be692b.zip |
Fix cursor offset with `Affinity::After` at the end of lines in `Editor::cursor`
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/src/text/editor.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/graphics/src/text/editor.rs b/graphics/src/text/editor.rs index 7b0ddec1..b39e9831 100644 --- a/graphics/src/text/editor.rs +++ b/graphics/src/text/editor.rs @@ -143,7 +143,10 @@ impl editor::Editor for Editor { None } }) - .unwrap_or((0, 0.0)); + .unwrap_or(( + 0, + layout.last().map(|line| line.w).unwrap_or(0.0), + )); let line_height = buffer.metrics().line_height; |