mirror of
https://github.com/ocornut/imgui.git
synced 2024-12-18 16:58:53 +08:00
SliderAngle: only write back to value v_rad on value_changed. (#8193)
Some checks failed
Some checks failed
This commit is contained in:
parent
dda7672008
commit
9b26743c6b
@ -3329,6 +3329,7 @@ bool ImGui::SliderAngle(const char* label, float* v_rad, float v_degrees_min, fl
|
|||||||
format = "%.0f deg";
|
format = "%.0f deg";
|
||||||
float v_deg = (*v_rad) * 360.0f / (2 * IM_PI);
|
float v_deg = (*v_rad) * 360.0f / (2 * IM_PI);
|
||||||
bool value_changed = SliderFloat(label, &v_deg, v_degrees_min, v_degrees_max, format, flags);
|
bool value_changed = SliderFloat(label, &v_deg, v_degrees_min, v_degrees_max, format, flags);
|
||||||
|
if (value_changed)
|
||||||
*v_rad = v_deg * (2 * IM_PI) / 360.0f;
|
*v_rad = v_deg * (2 * IM_PI) / 360.0f;
|
||||||
return value_changed;
|
return value_changed;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user