summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-06-17 03:37:00 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-06-17 03:37:00 +0200
commit6c1027af8d54ad21e282337b53097eb196d62c00 (patch)
treea25ed59cfe5a3197a88b787a4bc4d16af857e645 /widget
parente9141e7abff3ea59e8bc5d8e2e386d564180e0ae (diff)
downloadiced-6c1027af8d54ad21e282337b53097eb196d62c00.tar.gz
iced-6c1027af8d54ad21e282337b53097eb196d62c00.tar.bz2
iced-6c1027af8d54ad21e282337b53097eb196d62c00.zip
Fix `text_editor` always capturing scroll events
Diffstat (limited to 'widget')
-rw-r--r--widget/src/text_editor.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index 41b058af..fc2ade43 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -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();