Skip to content

Commit 274fe57

Browse files
committed
Revert changes for feature deprecation on 22.04 which then break builds on 18.04
1 parent 22b42f6 commit 274fe57

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/iconograph/canvas.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,18 @@ void Canvas::wheelEvent(QWheelEvent *event)
161161
this->offset = this->rect.topLeft();
162162
}
163163

164-
const auto position = event->position();
164+
// const auto position = event->position();
165165

166166
// Origin of zoom in image space
167-
const double x = (position.x() - this->offset.x()) / this->zoom;
168-
const double y = (position.y() - this->offset.y()) / this->zoom;
167+
const double x = (event->x() - this->offset.x()) / this->zoom;
168+
const double y = (event->y() - this->offset.y()) / this->zoom;
169+
const double step = event->delta() < 0 ? -0.05 : 0.05;
170+
171+
// Use these when only building for jammy or later
172+
// const double x = (position.x() - this->offset.x()) / this->zoom;
173+
// const double y = (position.y() - this->offset.y()) / this->zoom;
174+
// const double step = event->angleDelta().y() < 0 ? -0.05 : 0.05;
169175

170-
// double step = event->delta() < 0 ? -0.05 : 0.05;
171-
double step = event->angleDelta().y() < 0 ? -0.05 : 0.05;
172176
this->zoom = std::max(this->minScale, std::min(1.0, this->zoom + step));
173177
this->offset = {
174178
(int)lrint(position.x() - this->zoom * x),

0 commit comments

Comments
 (0)