Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/input/kis_zoom_action.cpp
Show All 28 Lines | |||||
29 | #include <kis_canvas2.h> | 29 | #include <kis_canvas2.h> | ||
30 | #include <kis_canvas_controller.h> | 30 | #include <kis_canvas_controller.h> | ||
31 | #include "kis_cursor.h" | 31 | #include "kis_cursor.h" | ||
32 | #include "KisViewManager.h" | 32 | #include "KisViewManager.h" | ||
33 | #include "kis_input_manager.h" | 33 | #include "kis_input_manager.h" | ||
34 | #include "kis_config.h" | 34 | #include "kis_config.h" | ||
35 | 35 | | |||
36 | 36 | | |||
37 | inline QPoint pointFromEvent(QEvent *event) { | 37 | QPoint KisZoomAction::pointFromEvent(QEvent *event) { | ||
38 | if (!event) { | 38 | if (!event) { | ||
39 | return QPoint(); | 39 | return inputManager()->canvas()->canvasWidget()->mapFromGlobal(QCursor::pos()); | ||
40 | } else if (QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event)) { | 40 | } else if (QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event)) { | ||
41 | return mouseEvent->pos(); | 41 | return mouseEvent->pos(); | ||
42 | } else if (QTabletEvent *tabletEvent = dynamic_cast<QTabletEvent*>(event)) { | 42 | } else if (QTabletEvent *tabletEvent = dynamic_cast<QTabletEvent*>(event)) { | ||
43 | return tabletEvent->pos(); | 43 | return tabletEvent->pos(); | ||
44 | } else if (QWheelEvent *wheelEvent = dynamic_cast<QWheelEvent*>(event)) { | 44 | } else if (QWheelEvent *wheelEvent = dynamic_cast<QWheelEvent*>(event)) { | ||
45 | return wheelEvent->pos(); | 45 | return wheelEvent->pos(); | ||
46 | } | 46 | } | ||
47 | 47 | | |||
▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines |