Avoid division by zero in grapheme_position
This commit is contained in:
parent
9c50a7ed7e
commit
3d88ceb482
1 changed files with 1 additions and 1 deletions
|
|
@ -219,7 +219,7 @@ impl core::text::Paragraph for Paragraph {
|
||||||
glyph.w
|
glyph.w
|
||||||
* (1.0
|
* (1.0
|
||||||
- graphemes_seen.saturating_sub(index) as f32
|
- graphemes_seen.saturating_sub(index) as f32
|
||||||
/ last_grapheme_count as f32)
|
/ last_grapheme_count.max(1) as f32)
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(Point::new(
|
Some(Point::new(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue