mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-24 00:28:38 -07:00
Merge 3e27d05c3d into 506fde8f86
This commit is contained in:
commit
ec06ef26ed
5 changed files with 13 additions and 9 deletions
|
|
@ -1182,8 +1182,8 @@ sla::DrainHoles SLAPrintObject::transformed_drainhole_points() const
|
|||
{
|
||||
assert(m_model_object != nullptr);
|
||||
auto pts = m_model_object->sla_drain_holes;
|
||||
auto tr = trafo().cast<float>();
|
||||
auto sc = m_model_object->instances.front()->get_scaling_factor().cast<float>();
|
||||
const Transform3f tr = trafo().cast<float>();
|
||||
const Vec3f sc = m_model_object->instances.front()->get_scaling_factor().cast<float>();
|
||||
for (sla::DrainHole &hl : pts) {
|
||||
hl.pos = tr * hl.pos;
|
||||
hl.normal = tr * hl.normal - tr.translation();
|
||||
|
|
|
|||
|
|
@ -208,8 +208,8 @@ bool GLGizmoBrimEars::unproject_on_mesh2(const Vec2d &mouse_pos, std::pair<Vec3f
|
|||
double clp_dist = m_c->object_clipper()->get_position();
|
||||
const ClippingPlane *clp = m_c->object_clipper()->get_clipping_plane();
|
||||
bool mouse_on_object = false;
|
||||
Vec3f position_on_model {};
|
||||
Vec3f normal_on_model {};
|
||||
Vec3f position_on_model { Vec3f::Zero() };
|
||||
Vec3f normal_on_model { Vec3f::Zero() };
|
||||
double closest_hit_distance = std::numeric_limits<double>::max();
|
||||
|
||||
for (auto item : m_mesh_raycaster_map) {
|
||||
|
|
|
|||
|
|
@ -1049,12 +1049,15 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
|
|||
PrintIndicator last_instance_printable = last_instance_node->IsPrintable();
|
||||
node_parent->GetChildren().Remove(last_instance_node);
|
||||
delete last_instance_node;
|
||||
// `delete` before `ItemDeleted()` is valid wxWidget pattern
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||
ItemDeleted(parent, wxDataViewItem(last_instance_node));
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
ObjectDataViewModelNode* obj_node = node_parent->GetParent();
|
||||
obj_node->set_printable_icon(last_instance_printable);
|
||||
obj_node->GetChildren().Remove(node_parent);
|
||||
delete node_parent;
|
||||
ret_item = wxDataViewItem(obj_node);
|
||||
|
||||
#ifndef __WXGTK__
|
||||
|
|
@ -1062,6 +1065,7 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
|
|||
obj_node->m_container = false;
|
||||
#endif //__WXGTK__
|
||||
ItemDeleted(ret_item, wxDataViewItem(node_parent));
|
||||
delete node_parent;
|
||||
return ret_item;
|
||||
}
|
||||
|
||||
|
|
@ -1073,7 +1077,6 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
|
|||
{
|
||||
ObjectDataViewModelNode* obj_node = node_parent->GetParent();
|
||||
obj_node->GetChildren().Remove(node_parent);
|
||||
delete node_parent;
|
||||
ret_item = wxDataViewItem(obj_node);
|
||||
|
||||
#ifndef __WXGTK__
|
||||
|
|
@ -1081,6 +1084,7 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
|
|||
obj_node->m_container = false;
|
||||
#endif //__WXGTK__
|
||||
ItemDeleted(ret_item, wxDataViewItem(node_parent));
|
||||
delete node_parent;
|
||||
return ret_item;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3166,7 +3166,7 @@ void Selection::paste_objects_from_clipboard()
|
|||
if (shift_all(0) != 0 || shift_all(1) != 0) {
|
||||
// BBS: if multiple objects are selected, move them as a whole after copy
|
||||
if (i == 0) empty_cell_all = wxGetApp().plater()->canvas3D()->get_nearest_empty_cell({start_point(0), start_point(1)}, {bbox.size()(0)+1,bbox.size()(1)+1});
|
||||
auto instance_shift = src_object->instances.front()->get_offset() - src_objects[0]->instances.front()->get_offset();
|
||||
const Vec3d instance_shift = src_object->instances.front()->get_offset() - src_objects[0]->instances.front()->get_offset();
|
||||
displacement = {shift_all.x() + empty_cell_all.x() + instance_shift.x(), shift_all.y() + empty_cell_all.y() + instance_shift.y(), start_offset(2)};
|
||||
} else {
|
||||
// BBS: if only one object is copied, find an empty cell to put it
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ void LabeledStaticBox::DrawBorderAndLabel(wxDC& dc)
|
|||
wxSize wSz = GetSize();
|
||||
|
||||
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
||||
dc.SetPen(wxPen(border_color.colorForStates(state_handler.states()), m_border_width, wxSOLID));
|
||||
dc.SetPen(wxPen(border_color.colorForStates(state_handler.states()), m_border_width, wxPENSTYLE_SOLID));
|
||||
dc.DrawRoundedRectangle( // Border
|
||||
std::max(0, m_pos.x),
|
||||
std::max(0, m_pos.y) + m_label_height * .5,
|
||||
|
|
@ -185,4 +185,4 @@ void LabeledStaticBox::GetBordersForSizer(int* borderTop, int* borderOther) cons
|
|||
#ifdef __WXOSX__
|
||||
*borderOther = 5; // Make sure macOS uses the same border padding as other platforms
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue