mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Various gizmos refactoring
This commit is contained in:
@@ -117,7 +117,6 @@ Selection::Selection()
|
||||
, m_type(Empty)
|
||||
, m_valid(false)
|
||||
, m_scale_factor(1.0f)
|
||||
, m_dragging(false)
|
||||
{
|
||||
this->set_bounding_boxes_dirty();
|
||||
}
|
||||
@@ -812,12 +811,11 @@ const BoundingBoxf3& Selection::get_scaled_instance_bounding_box() const
|
||||
return *m_scaled_instance_bounding_box;
|
||||
}
|
||||
|
||||
void Selection::start_dragging()
|
||||
void Selection::setup_cache()
|
||||
{
|
||||
if (!m_valid)
|
||||
return;
|
||||
|
||||
m_dragging = true;
|
||||
set_caches();
|
||||
}
|
||||
|
||||
@@ -1166,12 +1164,12 @@ void Selection::scale_to_fit_print_volume(const BuildVolume& volume)
|
||||
type.set_joint();
|
||||
|
||||
// apply scale
|
||||
start_dragging();
|
||||
setup_cache();
|
||||
scale(s * Vec3d::Ones(), type);
|
||||
wxGetApp().plater()->canvas3D()->do_scale(""); // avoid storing another snapshot
|
||||
|
||||
// center selection on print bed
|
||||
start_dragging();
|
||||
setup_cache();
|
||||
offset.z() = -get_bounding_box().min.z();
|
||||
translate(offset);
|
||||
wxGetApp().plater()->canvas3D()->do_move(""); // avoid storing another snapshot
|
||||
|
||||
Reference in New Issue
Block a user