mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-26 04:58:07 +00:00
Navigation: a wheel notch eases unless animation effects are reduced, as production (F-48)
This commit is contained in:
Generated
+1
@@ -1886,6 +1886,7 @@ name = "craft-pages"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
"craft-text",
|
||||
"craft-theme",
|
||||
"craft-ui",
|
||||
|
||||
@@ -41,8 +41,8 @@ fn from_name<T: serde::de::DeserializeOwned>(name: &str) -> Option<T> {
|
||||
}
|
||||
|
||||
impl PdfCraftApp {
|
||||
/// The canvas's navigation choices: the scroll speed, the middle-button direction and whether zooms ease. The
|
||||
/// rest keep the framework's defaults.
|
||||
/// The canvas's navigation choices: the scroll speed, the middle-button direction and whether zooms and wheel
|
||||
/// notches ease. The rest keep the framework's defaults.
|
||||
pub(crate) fn navigation_options(&self) -> craft::ui::canvas::NavigationOptions {
|
||||
let mut options = craft::ui::canvas::NavigationOptions::default();
|
||||
options.wheel_line = self.scroll_speed.wheel_line();
|
||||
@@ -52,7 +52,9 @@ impl PdfCraftApp {
|
||||
if cfg!(target_os = "linux") {
|
||||
options.middle_button = craft::behavior::MiddleButton::AutoScroll;
|
||||
}
|
||||
options.animated_zoom = !self.animation_effects.reduced(None);
|
||||
let eased = !self.animation_effects.reduced(None);
|
||||
options.animated_zoom = eased;
|
||||
options.eased_wheel = eased;
|
||||
options
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user