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,12 +456,16 @@ impl editor::Editor for Editor {
} }
} }
Action::Scroll { lines } => { Action::Scroll { lines } => {
let (_, height) = editor.buffer().size();
if height < i32::MAX as f32 {
editor.action( editor.action(
font_system.raw(), font_system.raw(),
cosmic_text::Action::Scroll { lines }, cosmic_text::Action::Scroll { lines },
); );
} }
} }
}
self.0 = Some(Arc::new(internal)); self.0 = Some(Arc::new(internal));
} }