changing type in emboss
This commit is contained in:
parent
7770034492
commit
ef3a2e2744
@ -1442,6 +1442,16 @@ void GLGizmoEmboss::draw_model_type()
|
|||||||
Plater::TakeSnapshot snapshot(plater, _L("Change Text Type"), UndoRedo::SnapshotType::GizmoAction);
|
Plater::TakeSnapshot snapshot(plater, _L("Change Text Type"), UndoRedo::SnapshotType::GizmoAction);
|
||||||
m_volume->set_type(*new_type);
|
m_volume->set_type(*new_type);
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectID volume_id = m_volume->id();
|
||||||
|
|
||||||
// inspiration in ObjectList::change_part_type()
|
// inspiration in ObjectList::change_part_type()
|
||||||
// how to view correct side panel with objects
|
// how to view correct side panel with objects
|
||||||
ObjectList *obj_list = app.obj_list();
|
ObjectList *obj_list = app.obj_list();
|
||||||
@ -1450,14 +1460,12 @@ void GLGizmoEmboss::draw_model_type()
|
|||||||
[volume = m_volume](const ModelVolume *vol) { return vol == volume; });
|
[volume = m_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
|
// NOTE: on linux, function reorder_volumes_and_get_selection call GLCanvas3D::reload_scene(refresh_immediately = false)
|
||||||
if (m_volume->text_configuration->font_item.prop.use_surface) {
|
// which discard m_volume pointer and set it to nullptr also selection is cleared so gizmo is automaticaly closed
|
||||||
// move inside
|
auto &mng = m_parent.get_gizmos_manager();
|
||||||
bool is_volume_move_inside = (type == part);
|
if (mng.get_current_type() != GLGizmosManager::Emboss)
|
||||||
bool is_volume_move_outside = (*new_type == part);
|
mng.open_gizmo(GLGizmosManager::Emboss);
|
||||||
if (is_volume_move_inside || is_volume_move_outside)
|
// TODO: select volume back - Ask @Sasa
|
||||||
process();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user