Fix surface after chenge position
Fix position when change type and using surface
This commit is contained in:
parent
8cf8e06164
commit
370e84b785
2 changed files with 16 additions and 3 deletions
|
@ -356,6 +356,13 @@ bool GLGizmoEmboss::on_mouse_for_translate(const wxMouseEvent &mouse_event)
|
|||
// Apply temporary position
|
||||
m_temp_transformation = {};
|
||||
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;
|
||||
}
|
||||
|
@ -1413,6 +1420,15 @@ void GLGizmoEmboss::draw_model_type()
|
|||
obj_list->get_selected_obj_idx(),
|
||||
[volume](const ModelVolume *vol) { return vol == volume; });
|
||||
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_rotate(float relative_z_angle);
|
||||
|
||||
// TODO: only for developing - remove it
|
||||
void use_surface();
|
||||
|
||||
/// <summary>
|
||||
/// Choose valid source Volume to project on(cut surface from).
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in a new issue