FIX: crash when print by object with multi-objects
jira: none Change-Id: If69324f3a01a0f0001fb05488cb91f0f74a08071
This commit is contained in:
parent
01460cae76
commit
ec11e25b43
|
@ -312,8 +312,8 @@ void IMSlider::SetLayersTimes(const std::vector<double> &layers_times)
|
||||||
|
|
||||||
void IMSlider::SetDrawMode(bool is_sequential_print)
|
void IMSlider::SetDrawMode(bool is_sequential_print)
|
||||||
{
|
{
|
||||||
m_draw_mode = is_sequential_print ? dmSequentialFffPrint :
|
m_draw_mode = is_sequential_print ? dmSequentialFffPrint :
|
||||||
dmRegular;
|
dmRegular;
|
||||||
m_can_change_color = m_can_change_color && !(m_draw_mode == dmSequentialFffPrint);
|
m_can_change_color = m_can_change_color && !(m_draw_mode == dmSequentialFffPrint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ bool IMSlider::check_ticks_changed_event(Type type)
|
||||||
_L("The last color change data was saved for a multi extruder printing.")) +
|
_L("The last color change data was saved for a multi extruder printing.")) +
|
||||||
"\n" + _L("Your current changes will delete all saved color changes.") + "\n\n\t" + _L("Are you sure you want to continue?");
|
"\n" + _L("Your current changes will delete all saved color changes.") + "\n\n\t" + _L("Are you sure you want to continue?");
|
||||||
|
|
||||||
|
|
||||||
GUI::MessageDialog msg(this, message, _L("Notice"), wxYES_NO);
|
GUI::MessageDialog msg(this, message, _L("Notice"), wxYES_NO);
|
||||||
if (msg.ShowModal() == wxID_YES) {
|
if (msg.ShowModal() == wxID_YES) {
|
||||||
m_ticks.erase_all_ticks_with_code(ColorChange);
|
m_ticks.erase_all_ticks_with_code(ColorChange);
|
||||||
|
@ -891,16 +891,16 @@ bool IMSlider::vertical_slider(const char* str_id, int* higher_value, int* lower
|
||||||
ImRect one_handle = ImRect(higher_handle.Min - ImVec2(one_handle_offset, 0), higher_handle.Max - ImVec2(one_handle_offset, 0));
|
ImRect one_handle = ImRect(higher_handle.Min - ImVec2(one_handle_offset, 0), higher_handle.Max - ImVec2(one_handle_offset, 0));
|
||||||
|
|
||||||
bool value_changed = false;
|
bool value_changed = false;
|
||||||
if (!one_layer_flag)
|
if (!one_layer_flag)
|
||||||
{
|
{
|
||||||
// select higher handle by default
|
// select higher handle by default
|
||||||
static bool h_selected = (selection == ssHigher);
|
static bool h_selected = (selection == ssHigher);
|
||||||
if (ImGui::ItemHoverable(higher_handle, id) && context.IO.MouseClicked[0]) {
|
if (ImGui::ItemHoverable(higher_handle, id) && context.IO.MouseClicked[0]) {
|
||||||
selection = ssHigher;
|
selection = ssHigher;
|
||||||
h_selected = true;
|
h_selected = true;
|
||||||
}
|
}
|
||||||
if (ImGui::ItemHoverable(lower_handle, id) && context.IO.MouseClicked[0]) {
|
if (ImGui::ItemHoverable(lower_handle, id) && context.IO.MouseClicked[0]) {
|
||||||
selection = ssLower;
|
selection = ssLower;
|
||||||
h_selected = false;
|
h_selected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -908,7 +908,7 @@ bool IMSlider::vertical_slider(const char* str_id, int* higher_value, int* lower
|
||||||
if (h_selected)
|
if (h_selected)
|
||||||
{
|
{
|
||||||
value_changed = slider_behavior(id, higher_slideable_region, v_min, v_max,
|
value_changed = slider_behavior(id, higher_slideable_region, v_min, v_max,
|
||||||
higher_value, &higher_handle, ImGuiSliderFlags_Vertical,
|
higher_value, &higher_handle, ImGuiSliderFlags_Vertical,
|
||||||
m_tick_value, m_tick_rect);
|
m_tick_value, m_tick_rect);
|
||||||
}
|
}
|
||||||
if (!h_selected) {
|
if (!h_selected) {
|
||||||
|
@ -997,7 +997,7 @@ bool IMSlider::vertical_slider(const char* str_id, int* higher_value, int* lower
|
||||||
draw_tick_on_mouse_position(h_selected ? higher_slideable_region : lower_slideable_region);
|
draw_tick_on_mouse_position(h_selected ? higher_slideable_region : lower_slideable_region);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (one_layer_flag)
|
if (one_layer_flag)
|
||||||
{
|
{
|
||||||
// update handle position
|
// update handle position
|
||||||
value_changed = slider_behavior(id, one_slideable_region, v_min, v_max,
|
value_changed = slider_behavior(id, one_slideable_region, v_min, v_max,
|
||||||
|
@ -1012,7 +1012,7 @@ bool IMSlider::vertical_slider(const char* str_id, int* higher_value, int* lower
|
||||||
if ((!ImGui::ItemHoverable(one_handle, id) && context.IO.MouseClicked[1]) ||
|
if ((!ImGui::ItemHoverable(one_handle, id) && context.IO.MouseClicked[1]) ||
|
||||||
context.IO.MouseClicked[0])
|
context.IO.MouseClicked[0])
|
||||||
m_show_menu = false;
|
m_show_menu = false;
|
||||||
|
|
||||||
ImVec2 bar_center = higher_handle.GetCenter();
|
ImVec2 bar_center = higher_handle.GetCenter();
|
||||||
|
|
||||||
// draw ticks
|
// draw ticks
|
||||||
|
@ -1322,7 +1322,7 @@ void IMSlider::render_add_menu()
|
||||||
}
|
}
|
||||||
if (hovered) { show_tooltip(_u8L("Insert a pause command at the beginning of this layer.")); }
|
if (hovered) { show_tooltip(_u8L("Insert a pause command at the beginning of this layer.")); }
|
||||||
|
|
||||||
|
|
||||||
if (menu_item_with_icon(_u8L("Add Custom G-code").c_str(), "", ImVec2(0, 0), 0, false, menu_item_enable, &hovered)) {
|
if (menu_item_with_icon(_u8L("Add Custom G-code").c_str(), "", ImVec2(0, 0), 0, false, menu_item_enable, &hovered)) {
|
||||||
m_show_custom_gcode_window = true;
|
m_show_custom_gcode_window = true;
|
||||||
}
|
}
|
||||||
|
@ -1446,7 +1446,7 @@ void IMSlider::on_mouse_wheel(wxMouseEvent& evt) {
|
||||||
}
|
}
|
||||||
else if (wxGetKeyState(WXK_RAW_CONTROL)) {
|
else if (wxGetKeyState(WXK_RAW_CONTROL)) {
|
||||||
wheel *= 5;
|
wheel *= 5;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (wxGetKeyState(WXK_COMMAND) || wxGetKeyState(WXK_SHIFT))
|
if (wxGetKeyState(WXK_COMMAND) || wxGetKeyState(WXK_SHIFT))
|
||||||
wheel *= 5;
|
wheel *= 5;
|
||||||
|
@ -1501,6 +1501,9 @@ void IMSlider::correct_higher_value()
|
||||||
|
|
||||||
bool IMSlider::is_wipe_tower_layer(int tick) const
|
bool IMSlider::is_wipe_tower_layer(int tick) const
|
||||||
{
|
{
|
||||||
|
// BBS: This function is useless in BBS
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!m_is_wipe_tower || tick >= (int) m_values.size()) return false;
|
if (!m_is_wipe_tower || tick >= (int) m_values.size()) return false;
|
||||||
if (tick == 0 || (tick == (int) m_values.size() - 1 && m_values[tick] > m_values[tick - 1])) return false;
|
if (tick == 0 || (tick == (int) m_values.size() - 1 && m_values[tick] > m_values[tick - 1])) return false;
|
||||||
if ((m_values[tick - 1] == m_values[tick + 1] && m_values[tick] < m_values[tick + 1]) ||
|
if ((m_values[tick - 1] == m_values[tick + 1] && m_values[tick] < m_values[tick + 1]) ||
|
||||||
|
|
Loading…
Reference in New Issue