From 640d1f459b76e8fce35790a07c58eb2dbb4ce68a Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 20 Apr 2026 13:30:41 +0300 Subject: [PATCH] [img-editor] Fixed wheel delta with pressed Shift while zoom canvas. --- Telegram/SourceFiles/editor/editor_paint.cpp | 3 ++- Telegram/SourceFiles/editor/photo_editor_content.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/editor/editor_paint.cpp b/Telegram/SourceFiles/editor/editor_paint.cpp index 5a28ee302f..15577df5c8 100644 --- a/Telegram/SourceFiles/editor/editor_paint.cpp +++ b/Telegram/SourceFiles/editor/editor_paint.cpp @@ -438,7 +438,8 @@ bool Paint::eventFilter(QObject *obj, QEvent *e) { } if (e->type() == QEvent::Wheel) { const auto wheel = static_cast(e); - const auto delta = wheel->angleDelta().y(); + const auto raw = wheel->angleDelta(); + const auto delta = raw.y() ? raw.y() : raw.x(); if (!delta) { return true; } diff --git a/Telegram/SourceFiles/editor/photo_editor_content.cpp b/Telegram/SourceFiles/editor/photo_editor_content.cpp index 97a56a706b..ef83d6b8a8 100644 --- a/Telegram/SourceFiles/editor/photo_editor_content.cpp +++ b/Telegram/SourceFiles/editor/photo_editor_content.cpp @@ -125,8 +125,9 @@ PhotoEditorContent::PhotoEditorContent( const auto type = e->type(); if (type == QEvent::Wheel) { const auto wheel = static_cast(e.get()); + const auto raw = wheel->angleDelta(); _paint->zoomSceneItems( - wheel->angleDelta().y(), + raw.y() ? raw.y() : raw.x(), wheel->modifiers().testFlag(Qt::ShiftModifier)); e->accept(); } else if (type == QEvent::MouseButtonPress) {