summaryrefslogtreecommitdiffstats
path: root/graphics/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-04-26 15:38:46 +0200
committerLibravatar GitHub <noreply@github.com>2024-04-26 15:38:46 +0200
commitce12231e22372eea0369f99b8fdfe26aa1240c57 (patch)
tree2ea1465ff65d10cd7dccaac6785d5544b071ce38 /graphics/src
parent40c4aa8ff25f27e9bbc43f8fc2aa161e63396172 (diff)
parent73088a6fc1567f8bd557fdf479e16b395032b019 (diff)
downloadiced-ce12231e22372eea0369f99b8fdfe26aa1240c57.tar.gz
iced-ce12231e22372eea0369f99b8fdfe26aa1240c57.tar.bz2
iced-ce12231e22372eea0369f99b8fdfe26aa1240c57.zip
Merge pull request #2407 from iced-rs/fix/text-editor-quirks
Fix some `text_editor` quirks
Diffstat (limited to 'graphics/src')
-rw-r--r--graphics/src/text/editor.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/graphics/src/text/editor.rs b/graphics/src/text/editor.rs
index c488a51c..4b8f0f2a 100644
--- a/graphics/src/text/editor.rs
+++ b/graphics/src/text/editor.rs
@@ -456,10 +456,14 @@ impl editor::Editor for Editor {
}
}
Action::Scroll { lines } => {
- editor.action(
- font_system.raw(),
- cosmic_text::Action::Scroll { lines },
- );
+ let (_, height) = editor.buffer().size();
+
+ if height < i32::MAX as f32 {
+ editor.action(
+ font_system.raw(),
+ cosmic_text::Action::Scroll { lines },
+ );
+ }
}
}