Skip to content

Commit

Permalink
SliderAngle: only write back to value v_rad on value_changed. (#8193)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimateos authored Nov 29, 2024
1 parent dda7672 commit 9b26743
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3329,7 +3329,8 @@ bool ImGui::SliderAngle(const char* label, float* v_rad, float v_degrees_min, fl
format = "%.0f deg";
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);
*v_rad = v_deg * (2 * IM_PI) / 360.0f;
if (value_changed)
*v_rad = v_deg * (2 * IM_PI) / 360.0f;
return value_changed;
}

Expand Down

0 comments on commit 9b26743

Please sign in to comment.