Merge pull request #2381 from dra11y/fix-magnifier-scroll

fix(magnifier): smooth mouse wheel zoom and respect natural scroll direction
This commit is contained in:
Levi Portenier 2026-05-20 11:39:42 -06:00 committed by GitHub
commit 8450e89de4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 8 deletions

View file

@ -9,7 +9,7 @@ use cosmic::{
};
use cosmic_comp_config::ZoomMovement;
use cosmic_config::ConfigSet;
use keyframe::{ease, functions::EaseInOutCubic};
use keyframe::{ease, functions::Linear};
use smithay::{
backend::renderer::{ImportMem, Renderer, element::AsRenderElements},
desktop::space::SpaceElement,
@ -135,7 +135,7 @@ impl OutputZoomState {
let percentage =
duration_since.as_millis() as f32 / ANIMATION_DURATION.as_millis() as f32;
ease(
EaseInOutCubic,
Linear,
EasePoint(*old_point),
EasePoint(self.focal_point),
percentage,
@ -159,7 +159,7 @@ impl OutputZoomState {
let percentage = Instant::now().duration_since(*start).as_millis() as f32
/ ANIMATION_DURATION.as_millis() as f32;
ease(EaseInOutCubic, *old_level, self.level, percentage)
ease(Linear, *old_level, self.level, percentage)
} else {
self.level
}