mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 09:56:04 +08:00
Fix surface after chenge position
Fix position when change type and using surface
This commit is contained in:
parent
8cf8e06164
commit
370e84b785
@ -356,6 +356,13 @@ bool GLGizmoEmboss::on_mouse_for_translate(const wxMouseEvent &mouse_event)
|
|||||||
// Apply temporary position
|
// Apply temporary position
|
||||||
m_temp_transformation = {};
|
m_temp_transformation = {};
|
||||||
m_dragging_mouse_offset = {};
|
m_dragging_mouse_offset = {};
|
||||||
|
|
||||||
|
// Update surface by new position
|
||||||
|
if (m_volume->text_configuration->font_item.prop.use_surface) {
|
||||||
|
// need actual position
|
||||||
|
m_volume->set_transformation(volume_trmat);
|
||||||
|
process();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1413,6 +1420,15 @@ void GLGizmoEmboss::draw_model_type()
|
|||||||
obj_list->get_selected_obj_idx(),
|
obj_list->get_selected_obj_idx(),
|
||||||
[volume](const ModelVolume *vol) { return vol == volume; });
|
[volume](const ModelVolume *vol) { return vol == volume; });
|
||||||
if (!sel.IsEmpty()) obj_list->select_item(sel.front());
|
if (!sel.IsEmpty()) obj_list->select_item(sel.front());
|
||||||
|
|
||||||
|
// Update volume position when switch from part or into part
|
||||||
|
if (m_volume->text_configuration->font_item.prop.use_surface) {
|
||||||
|
// move inside
|
||||||
|
bool is_volume_move_inside = (type == part);
|
||||||
|
bool is_volume_move_outside = (*new_type == part);
|
||||||
|
if (is_volume_move_inside || is_volume_move_outside)
|
||||||
|
process();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,9 +112,6 @@ private:
|
|||||||
void do_translate(const Vec3d& relative_move);
|
void do_translate(const Vec3d& relative_move);
|
||||||
void do_rotate(float relative_z_angle);
|
void do_rotate(float relative_z_angle);
|
||||||
|
|
||||||
// TODO: only for developing - remove it
|
|
||||||
void use_surface();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Choose valid source Volume to project on(cut surface from).
|
/// Choose valid source Volume to project on(cut surface from).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user