mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Merge branch 'main' into dev/p2s-pr
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
#include "DailyTips.hpp"
|
||||
#include "FilamentMapDialog.hpp"
|
||||
|
||||
#include "slic3r/GUI/CameraUtils.hpp"
|
||||
#include "slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp"
|
||||
#include "slic3r/Utils/UndoRedo.hpp"
|
||||
#include "slic3r/Utils/MacDarkMode.hpp"
|
||||
@@ -4695,7 +4694,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||
|
||||
m_camera_movement = true;
|
||||
m_mouse.drag.start_position_2D = pos;
|
||||
m_mouse.drag.move_start_threshold_position_2D = pos;
|
||||
}
|
||||
}
|
||||
else if ((evt.LeftUp() || evt.MiddleUp() || evt.RightUp()) ||
|
||||
@@ -9378,18 +9376,12 @@ Vec3d GLCanvas3D::_mouse_to_3d(const Point& mouse_pos, float* z)
|
||||
if (m_canvas == nullptr)
|
||||
return Vec3d(DBL_MAX, DBL_MAX, DBL_MAX);
|
||||
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
|
||||
if (z == nullptr) {
|
||||
const SceneRaycaster::HitResult hit = m_scene_raycaster.hit(mouse_pos.cast<double>(), camera, nullptr);
|
||||
const SceneRaycaster::HitResult hit = m_scene_raycaster.hit(mouse_pos.cast<double>(), wxGetApp().plater()->get_camera(), nullptr);
|
||||
return hit.is_valid() ? hit.position.cast<double>() : _mouse_to_bed_3d(mouse_pos);
|
||||
}
|
||||
// Orca: Handling of the particular case, if we want to get the position for Z = 0
|
||||
else if (is_approx(static_cast<double>(*z), 0.)) {
|
||||
Vec2d position = CameraUtils::get_z0_position(camera, Vec2d(mouse_pos.x(), mouse_pos.y()));
|
||||
return Vec3d(position.x(), position.y(), *z);
|
||||
}
|
||||
else {
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
const Vec4i32 viewport(camera.get_viewport().data());
|
||||
Vec3d out;
|
||||
igl::unproject(Vec3d(mouse_pos.x(), viewport[3] - mouse_pos.y(), *z), camera.get_view_matrix().matrix(), camera.get_projection_matrix().matrix(), viewport, out);
|
||||
|
||||
Reference in New Issue
Block a user