Added input validation in painting gizmo (some values led to a crash)
This commit is contained in:
parent
802d675784
commit
97d95e814f
3 changed files with 6 additions and 0 deletions
|
@ -193,6 +193,8 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
||||||
ImGui::PopTextWrapPos();
|
ImGui::PopTextWrapPos();
|
||||||
ImGui::EndTooltip();
|
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();
|
ImGui::AlignTextToFramePadding();
|
||||||
|
|
|
@ -343,6 +343,8 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
||||||
ImGui::PopTextWrapPos();
|
ImGui::PopTextWrapPos();
|
||||||
ImGui::EndTooltip();
|
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();
|
ImGui::AlignTextToFramePadding();
|
||||||
m_imgui->text(m_desc.at("cursor_type"));
|
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::PopTextWrapPos();
|
||||||
ImGui::EndTooltip();
|
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();
|
ImGui::AlignTextToFramePadding();
|
||||||
|
|
Loading…
Reference in a new issue