mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-10 20:39:36 -06:00
address review: keep zero-character leading rows in row_span_at
This commit is contained in:
@@ -213,7 +213,7 @@ pub fn editor(
|
||||
/// The (min y, max y) of the row holding char index `at`; `walk` (row index, chars through that
|
||||
/// row) carries over between calls, so successive non-decreasing `at`s cost one pass in all.
|
||||
fn row_span_at(galley: &Galley, walk: &mut (usize, usize), at: usize) -> (f32, f32) {
|
||||
while walk.1 <= at && walk.0 + 1 < galley.rows.len() {
|
||||
while walk.0 + 1 < galley.rows.len() && (walk.1 < at || (walk.1 == at && galley.rows[walk.0].char_count_including_newline().0 > 0)) {
|
||||
walk.0 += 1;
|
||||
walk.1 += galley.rows[walk.0].char_count_including_newline().0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user