Fix:
../src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp:109:23: warning: comparison of integer expressions of different signedness: 'std::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare] ../src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp:132:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security] ../src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp:171:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security] Severity Code Description Project File Line Suppression State Warning C26451 Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2). libslic3r_gui C:\GIT\slic3r\src\slic3r\GUI\Gizmos\GLGizmoSimplify.cpp 143
This commit is contained in:
parent
9ea3be485f
commit
673a2bdac8
@ -129,7 +129,7 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
|
|||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
m_imgui->disabled_begin(m_configuration.use_count);
|
m_imgui->disabled_begin(m_configuration.use_count);
|
||||||
ImGui::Text(tr_detail_level.c_str());
|
ImGui::Text("%s", tr_detail_level.c_str());
|
||||||
std::vector<std::string> reduce_captions = {
|
std::vector<std::string> reduce_captions = {
|
||||||
static_cast<std::string>(_u8L("Extra high")),
|
static_cast<std::string>(_u8L("Extra high")),
|
||||||
static_cast<std::string>(_u8L("High")),
|
static_cast<std::string>(_u8L("High")),
|
||||||
@ -139,17 +139,17 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
|
|||||||
};
|
};
|
||||||
ImGui::SameLine(m_gui_cfg->bottom_left_width);
|
ImGui::SameLine(m_gui_cfg->bottom_left_width);
|
||||||
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
|
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
|
||||||
static int reduction = 3;
|
static int reduction = 2;
|
||||||
if(ImGui::SliderInt("##ReductionLevel", &reduction, 1, 5, reduce_captions[reduction-1].c_str())) {
|
if(ImGui::SliderInt("##ReductionLevel", &reduction, 0, 4, reduce_captions[reduction].c_str())) {
|
||||||
m_is_valid_result = false;
|
m_is_valid_result = false;
|
||||||
if (reduction < 1) reduction = 1;
|
if (reduction < 0) reduction = 0;
|
||||||
if (reduction > 5) reduction = 5;
|
if (reduction > 4) reduction = 4;
|
||||||
switch (reduction) {
|
switch (reduction) {
|
||||||
case 1: m_configuration.max_error = 1e-3f; break;
|
case 0: m_configuration.max_error = 1e-3f; break;
|
||||||
case 2: m_configuration.max_error = 1e-2f; break;
|
case 1: m_configuration.max_error = 1e-2f; break;
|
||||||
case 3: m_configuration.max_error = 0.1f; break;
|
case 2: m_configuration.max_error = 0.1f; break;
|
||||||
case 4: m_configuration.max_error = 0.5f; break;
|
case 3: m_configuration.max_error = 0.5f; break;
|
||||||
case 5: m_configuration.max_error = 1.f; break;
|
case 4: m_configuration.max_error = 1.f; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_imgui->disabled_end(); // !use_count
|
m_imgui->disabled_end(); // !use_count
|
||||||
@ -168,7 +168,7 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_imgui->disabled_begin(!m_configuration.use_count);
|
m_imgui->disabled_begin(!m_configuration.use_count);
|
||||||
ImGui::Text(tr_decimate_ratio.c_str());
|
ImGui::Text("%s", tr_decimate_ratio.c_str());
|
||||||
ImGui::SameLine(m_gui_cfg->bottom_left_width);
|
ImGui::SameLine(m_gui_cfg->bottom_left_width);
|
||||||
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
|
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
|
||||||
const char * format = (m_configuration.decimate_ratio > 10)? "%.0f %%":
|
const char * format = (m_configuration.decimate_ratio > 10)? "%.0f %%":
|
||||||
|
@ -87,7 +87,7 @@ private:
|
|||||||
int window_padding = 0;
|
int window_padding = 0;
|
||||||
|
|
||||||
// trunc model name when longer
|
// trunc model name when longer
|
||||||
int max_char_in_name = 30;
|
size_t max_char_in_name = 30;
|
||||||
};
|
};
|
||||||
std::optional<GuiCfg> m_gui_cfg;
|
std::optional<GuiCfg> m_gui_cfg;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user