summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--graphics/src/text/editor.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/src/text/editor.rs b/graphics/src/text/editor.rs
index b39e9831..52a5d942 100644
--- a/graphics/src/text/editor.rs
+++ b/graphics/src/text/editor.rs
@@ -144,7 +144,7 @@ impl editor::Editor for Editor {
}
})
.unwrap_or((
- 0,
+ layout.len().saturating_sub(1),
layout.last().map(|line| line.w).unwrap_or(0.0),
));