mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 11:30:41 +08:00
Set volume only by function data_changed.
This commit is contained in:
parent
af21038d94
commit
4c0e7d9683
@ -521,7 +521,7 @@ static void draw_mouse_offset(const std::optional<Vec2d> &offset)
|
||||
|
||||
void GLGizmoEmboss::on_render_input_window(float x, float y, float bottom_limit)
|
||||
{
|
||||
set_volume_by_selection();
|
||||
assert(m_volume != nullptr);
|
||||
// Do not render window for not selected text volume
|
||||
if (m_volume == nullptr ||
|
||||
get_model_volume(m_volume_id, m_parent.get_selection().get_model()->objects) == nullptr ||
|
||||
@ -665,20 +665,9 @@ void GLGizmoEmboss::on_set_state()
|
||||
// to reload fonts from system, when install new one
|
||||
wxFontEnumerator::InvalidateCache();
|
||||
|
||||
// Try(when exist) set text configuration by volume
|
||||
set_volume_by_selection();
|
||||
|
||||
// when open window by "T" and no valid volume is selected, so Create new one
|
||||
if (m_volume == nullptr ||
|
||||
get_model_volume(m_volume_id, m_parent.get_selection().get_model()->objects) == nullptr ) {
|
||||
// reopen gizmo when new object is created
|
||||
GLGizmoBase::m_state = GLGizmoBase::Off;
|
||||
if (wxGetApp().get_mode() == comSimple || wxGetApp().obj_list()->has_selected_cut_object())
|
||||
// It's impossible to add a part in simple mode
|
||||
return;
|
||||
// start creating new object
|
||||
create_volume(ModelVolumeType::MODEL_PART);
|
||||
}
|
||||
// Immediately after set state On is called function data_changed(),
|
||||
// where one could distiguish undo/redo serialization from opening by letter 'T'
|
||||
//set_volume_by_selection();
|
||||
|
||||
// change position of just opened emboss window
|
||||
if (m_allow_open_near_volume) {
|
||||
@ -696,8 +685,22 @@ void GLGizmoEmboss::on_set_state()
|
||||
}
|
||||
}
|
||||
|
||||
void GLGizmoEmboss::data_changed(bool is_serializing) {
|
||||
void GLGizmoEmboss::data_changed(bool is_serializing) {
|
||||
if (is_serializing)
|
||||
reset_volume();
|
||||
|
||||
set_volume_by_selection();
|
||||
|
||||
// when open window by "T" and no valid volume is selected, so Create new one
|
||||
if (!is_serializing && m_volume == nullptr) {
|
||||
// reopen gizmo when new object is created
|
||||
close();
|
||||
if (wxGetApp().get_mode() == comSimple || wxGetApp().obj_list()->has_selected_cut_object())
|
||||
// It's impossible to add a part in simple mode
|
||||
return;
|
||||
// start creating new object
|
||||
create_volume(ModelVolumeType::MODEL_PART);
|
||||
}
|
||||
}
|
||||
|
||||
void GLGizmoEmboss::on_start_dragging() { m_rotate_gizmo.start_dragging(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user