1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
colmap (3.7-2) unstable; urgency=medium
.
* Add patch that upstream recommends for GUI.
Author: Gürkan Myczko <tar@debian.org>
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2022-01-26
--- colmap-3.7.orig/src/ui/model_viewer_widget.cc
+++ colmap-3.7/src/ui/model_viewer_widget.cc
@@ -628,14 +628,16 @@ void ModelViewerWidget::mouseMoveEvent(Q
}
void ModelViewerWidget::wheelEvent(QWheelEvent* event) {
- if (event->modifiers() & Qt::ControlModifier) {
- ChangePointSize(event->angleDelta().y());
- } else if (event->modifiers() & Qt::AltModifier) {
- ChangeCameraSize(event->angleDelta().y());
- } else if (event->modifiers() & Qt::ShiftModifier) {
- ChangeNearPlane(event->angleDelta().y());
+ // We don't mind whether horizontal or vertical scroll.
+ const float delta = event->angleDelta().x() + event->angleDelta().y();
+ if (event->modifiers().testFlag(Qt::ControlModifier)) {
+ ChangePointSize(delta);
+ } else if (event->modifiers().testFlag(Qt::AltModifier)) {
+ ChangeCameraSize(delta);
+ } else if (event->modifiers().testFlag(Qt::ShiftModifier)) {
+ ChangeNearPlane(delta);
} else {
- ChangeFocusDistance(event->angleDelta().y());
+ ChangeFocusDistance(delta);
}
event->accept();
}
|