mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 12:42:03 +08:00
CutGizmo: Respect to the SLA shift
This commit is contained in:
parent
ddf636fe38
commit
760f74ce6a
@ -876,6 +876,7 @@ void GLGizmoCut3D::on_set_state()
|
|||||||
}
|
}
|
||||||
m_selected.clear();
|
m_selected.clear();
|
||||||
m_parent.set_use_color_clip_plane(false);
|
m_parent.set_use_color_clip_plane(false);
|
||||||
|
m_c->selection_info()->set_use_shift(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1239,7 +1240,10 @@ BoundingBoxf3 GLGizmoCut3D::transformed_bounding_box(const Vec3d& plane_center,
|
|||||||
{
|
{
|
||||||
const Selection& selection = m_parent.get_selection();
|
const Selection& selection = m_parent.get_selection();
|
||||||
|
|
||||||
const Vec3d& instance_offset = selection.get_first_volume()->get_instance_offset();
|
const auto first_volume = selection.get_first_volume();
|
||||||
|
Vec3d instance_offset = first_volume->get_instance_offset();
|
||||||
|
instance_offset[Z] += first_volume->get_sla_shift_z();
|
||||||
|
|
||||||
const auto cut_matrix = Transform3d::Identity() * rotation_m.inverse() * translation_transform(instance_offset - plane_center);
|
const auto cut_matrix = Transform3d::Identity() * rotation_m.inverse() * translation_transform(instance_offset - plane_center);
|
||||||
|
|
||||||
const Selection::IndicesList& idxs = selection.get_volume_idxs();
|
const Selection::IndicesList& idxs = selection.get_volume_idxs();
|
||||||
@ -1357,6 +1361,12 @@ void GLGizmoCut3D::render_clipper_cut()
|
|||||||
|
|
||||||
void GLGizmoCut3D::on_render()
|
void GLGizmoCut3D::on_render()
|
||||||
{
|
{
|
||||||
|
if (m_state == On) {
|
||||||
|
// This gizmo is showing the object elevated. Tell the common
|
||||||
|
// SelectionInfo object to lie about the actual shift.
|
||||||
|
m_c->selection_info()->set_use_shift(true);
|
||||||
|
}
|
||||||
|
|
||||||
update_clipper();
|
update_clipper();
|
||||||
|
|
||||||
init_picking_models();
|
init_picking_models();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user