mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-06 08:26:03 +08:00
Prevent creation volume on undo redo action.
This commit is contained in:
parent
369a881872
commit
51db683c9d
@ -521,6 +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)
|
void GLGizmoEmboss::on_render_input_window(float x, float y, float bottom_limit)
|
||||||
{
|
{
|
||||||
|
m_is_just_opened = false;
|
||||||
assert(m_volume != nullptr);
|
assert(m_volume != nullptr);
|
||||||
// Do not render window for not selected text volume
|
// Do not render window for not selected text volume
|
||||||
if (m_volume == nullptr ||
|
if (m_volume == nullptr ||
|
||||||
@ -668,6 +669,7 @@ void GLGizmoEmboss::on_set_state()
|
|||||||
// Immediately after set state On is called function data_changed(),
|
// Immediately after set state On is called function data_changed(),
|
||||||
// where one could distiguish undo/redo serialization from opening by letter 'T'
|
// where one could distiguish undo/redo serialization from opening by letter 'T'
|
||||||
//set_volume_by_selection();
|
//set_volume_by_selection();
|
||||||
|
m_is_just_opened = true;
|
||||||
|
|
||||||
// change position of just opened emboss window
|
// change position of just opened emboss window
|
||||||
if (m_allow_open_near_volume) {
|
if (m_allow_open_near_volume) {
|
||||||
@ -692,7 +694,7 @@ void GLGizmoEmboss::data_changed(bool is_serializing) {
|
|||||||
set_volume_by_selection();
|
set_volume_by_selection();
|
||||||
|
|
||||||
// when open window by "T" and no valid volume is selected, so Create new one
|
// when open window by "T" and no valid volume is selected, so Create new one
|
||||||
if (!is_serializing && m_volume == nullptr) {
|
if (!is_serializing && m_is_just_opened && m_volume == nullptr) {
|
||||||
// reopen gizmo when new object is created
|
// reopen gizmo when new object is created
|
||||||
close();
|
close();
|
||||||
if (wxGetApp().get_mode() == comSimple || wxGetApp().obj_list()->has_selected_cut_object())
|
if (wxGetApp().get_mode() == comSimple || wxGetApp().obj_list()->has_selected_cut_object())
|
||||||
|
@ -302,6 +302,10 @@ private:
|
|||||||
// True when m_text contain character unknown by selected font
|
// True when m_text contain character unknown by selected font
|
||||||
bool m_text_contain_unknown_glyph = false;
|
bool m_text_contain_unknown_glyph = false;
|
||||||
|
|
||||||
|
// True from on_set_state(State::On) to first call of on_render_input_window()
|
||||||
|
// To know that on data_change when no volume is selected create new one
|
||||||
|
bool m_is_just_opened = false;
|
||||||
|
|
||||||
// cancel for previous update of volume to cancel finalize part
|
// cancel for previous update of volume to cancel finalize part
|
||||||
std::shared_ptr<std::atomic<bool>> m_job_cancel;
|
std::shared_ptr<std::atomic<bool>> m_job_cancel;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user