mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
FIX: modify touchpad translate in Canvas3D
1. invert touchpad move direction 2. fix canvas 3d move with rotation 3. press shift for move Change-Id: I9c7f39eba45a168c92d4459cd88896d26ec6e8db
This commit is contained in:
parent
8c39e3f6f5
commit
ddee1dacaf
2 changed files with 8 additions and 4 deletions
|
@ -2952,9 +2952,12 @@ void GLCanvas3D::on_gesture(wxGestureEvent &evt)
|
|||
|
||||
auto & camera = wxGetApp().plater()->get_camera();
|
||||
if (evt.GetEventType() == wxEVT_GESTURE_PAN) {
|
||||
auto p = evt.GetPosition();
|
||||
auto d = static_cast<wxPanGestureEvent&>(evt).GetDelta();
|
||||
Vec3d delta{(double) d.x, (double) d.y, 0};
|
||||
camera.set_target(camera.get_target() + delta);
|
||||
float z = 0;
|
||||
const Vec3d &p2 = _mouse_to_3d({p.x, p.y}, &z);
|
||||
const Vec3d &p1 = _mouse_to_3d({p.x - d.x, p.y - d.y}, &z);
|
||||
camera.set_target(camera.get_target() + p2 - p1);
|
||||
} else if (evt.GetEventType() == wxEVT_GESTURE_ZOOM) {
|
||||
static float zoom_start = 1;
|
||||
if (evt.IsGestureStart())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue