FIX: gizmotext thickness value clamp to a range

jira: new

Change-Id: Ie64c1d95fdf067980d194d1ba12affbf1a76d6e0
This commit is contained in:
liz.li 2024-03-21 10:13:41 +08:00 committed by Lane.Wei
parent ecb1712a54
commit 83fda76852
2 changed files with 3 additions and 2 deletions

View File

@ -781,8 +781,7 @@ void GLGizmoText::on_render_input_window(float x, float y, float bottom_limit)
ImGui::PushItemWidth(list_width);
float old_value = m_thickness;
ImGui::InputFloat("###text_thickness", &m_thickness, 0.0f, 0.0f, "%.2f");
if (m_thickness < 0.1f)
m_thickness = 0.1f;
m_thickness = ImClamp(m_thickness, m_thickness_min, m_thickness_max);
if (old_value != m_thickness)
m_need_update_text = true;

View File

@ -26,6 +26,8 @@ private:
bool m_bold = true;
bool m_italic = false;
float m_thickness = 2.f;
float m_thickness_min = 0.f;
float m_thickness_max = 999.99f;
float m_embeded_depth = 0.f;
float m_rotate_angle = 0;
float m_text_gap = 0.f;