mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
[img-editor] Fixed wheel delta with pressed Shift while zoom canvas.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user