Fix panic when scrolling a TextEditor inside a scrollable

This commit is contained in:
Héctor Ramón Jiménez 2024-04-26 15:17:10 +02:00
parent 40c4aa8ff2
commit 3762c0590c
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -456,10 +456,14 @@ impl editor::Editor for Editor {
} }
} }
Action::Scroll { lines } => { Action::Scroll { lines } => {
editor.action( let (_, height) = editor.buffer().size();
font_system.raw(),
cosmic_text::Action::Scroll { lines }, if height < i32::MAX as f32 {
); editor.action(
font_system.raw(),
cosmic_text::Action::Scroll { lines },
);
}
} }
} }