Added input validation in painting gizmo (some values led to a crash)
This commit is contained in:
parent
802d675784
commit
97d95e814f
@ -193,6 +193,8 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
// Manually inserted values aren't clamped by ImGui. Zero cursor size results in a crash.
|
||||
m_cursor_radius = std::clamp(m_cursor_radius, CursorRadiusMin, CursorRadiusMax);
|
||||
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
|
@ -343,6 +343,8 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
// Manually inserted values aren't clamped by ImGui. Zero cursor size results in a crash.
|
||||
m_cursor_radius = std::clamp(m_cursor_radius, CursorRadiusMin, CursorRadiusMax);
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("cursor_type"));
|
||||
|
@ -148,6 +148,8 @@ void GLGizmoSeam::on_render_input_window(float x, float y, float bottom_limit)
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
// Manually inserted values aren't clamped by ImGui. Zero cursor size results in a crash.
|
||||
m_cursor_radius = std::clamp(m_cursor_radius, CursorRadiusMin, CursorRadiusMax);
|
||||
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
|
Loading…
Reference in New Issue
Block a user