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,14 +456,10 @@ impl editor::Editor for Editor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Action::Scroll { lines } => {
|
Action::Scroll { lines } => {
|
||||||
let (_, height) = editor.buffer().size();
|
editor.action(
|
||||||
|
font_system.raw(),
|
||||||
if height < i32::MAX as f32 {
|
cosmic_text::Action::Scroll { lines },
|
||||||
editor.action(
|
);
|
||||||
font_system.raw(),
|
|
||||||
cosmic_text::Action::Scroll { lines },
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -466,6 +466,12 @@ where
|
||||||
shell.publish(on_edit(action));
|
shell.publish(on_edit(action));
|
||||||
}
|
}
|
||||||
Update::Scroll(lines) => {
|
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;
|
let lines = lines + state.partial_scroll;
|
||||||
state.partial_scroll = lines.fract();
|
state.partial_scroll = lines.fract();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue