Fix text_editor always capturing scroll events
This commit is contained in:
parent
e9141e7abf
commit
6c1027af8d
2 changed files with 10 additions and 8 deletions
|
|
@ -456,16 +456,12 @@ impl editor::Editor for Editor {
|
|||
}
|
||||
}
|
||||
Action::Scroll { lines } => {
|
||||
let (_, height) = editor.buffer().size();
|
||||
|
||||
if height < i32::MAX as f32 {
|
||||
editor.action(
|
||||
font_system.raw(),
|
||||
cosmic_text::Action::Scroll { lines },
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.0 = Some(Arc::new(internal));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -466,6 +466,12 @@ where
|
|||
shell.publish(on_edit(action));
|
||||
}
|
||||
Update::Scroll(lines) => {
|
||||
let bounds = self.content.0.borrow().editor.bounds();
|
||||
|
||||
if bounds.height >= i32::MAX as f32 {
|
||||
return event::Status::Ignored;
|
||||
}
|
||||
|
||||
let lines = lines + state.partial_scroll;
|
||||
state.partial_scroll = lines.fract();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue