[img-editor] Fixed wheel delta with pressed Shift while zoom canvas.

This commit is contained in:
23rd
2026-04-20 13:30:41 +03:00
parent 8386608953
commit 640d1f459b
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -438,7 +438,8 @@ bool Paint::eventFilter(QObject *obj, QEvent *e) {
}
if (e->type() == QEvent::Wheel) {
const auto wheel = static_cast<QWheelEvent*>(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;
}
@@ -125,8 +125,9 @@ PhotoEditorContent::PhotoEditorContent(
const auto type = e->type();
if (type == QEvent::Wheel) {
const auto wheel = static_cast<QWheelEvent*>(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) {