FIX:clamp value should meet with v_max > v_min + 0.001

Jira: STUDIO-4870
Change-Id: I794312f654c03e75625d0b573bf7058248521242
This commit is contained in:
zhou.xu 2023-10-25 15:13:57 +08:00 committed by Lane.Wei
parent faaaaf3684
commit baaaeb0e14
1 changed files with 3 additions and 1 deletions

View File

@ -3070,7 +3070,9 @@ bool ImGui::BBLDragFloat(const char *label, float *v, float v_speed, float v_min
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.00f, 0.68f, 0.26f, 0.00f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.00f, 0.68f, 0.26f, 0.00f));
bool bbl_drag_scalar = BBLDragScalar(label, ImGuiDataType_Float, v, v_speed, &v_min, &v_max, format, flags);
*v = std::clamp(*v, v_min, v_max);
if (v_max > v_min + 0.001) {
*v = std::clamp(*v, v_min, v_max);
}
ImGui::PopStyleColor(3);
return bbl_drag_scalar;
}