mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Drag, Sliders: Merged ImGuiDragFlags back into ImGuiSliderFlags. (#3361, #1823, #1316, #642, #1829, #3209)
Technically API breaking (but ImGuiDragFlags were pushed on master 16 hours ago)
This commit is contained in:
@ -41,8 +41,7 @@ Breaking Changes:
|
||||
- DragFloat(), DragFloat2(), DragFloat3(), DragFloat4(), DragFloatRange2(), DragScalar(), DragScalarN()
|
||||
- SliderFloat(), SliderFloat2(), SliderFloat3(), SliderFloat4(), SliderScalar(), SliderScalarN()
|
||||
- VSliderFloat(), VSliderScalar()
|
||||
Replaced the 'float power=1.0f' argument with integer-based flags defaulting to 0 (as with all our flags).
|
||||
The type of those flags are ImGuiDragFlags and ImGuiSliderFlags (underlying int storage).
|
||||
Replaced the 'float power=1.0f' argument with ImGuiSliderFlags flags defaulting to 0 (as with all our flags).
|
||||
Worked out a backward-compatibility scheme so hopefully most C++ codebase should not be affected.
|
||||
In short, when calling those functions:
|
||||
- If you omitted the 'power' parameter (likely!), you are not affected.
|
||||
@ -53,10 +52,10 @@ Breaking Changes:
|
||||
- If you set the 'power' parameter to >1.0f (to enable non-linear editing):
|
||||
- Your compiler may warn on float>int conversion.
|
||||
- Code will assert at runtime for IM_ASSERT(power == 1.0f) with the following assert description:
|
||||
"Call Drag function with ImGuiDragFlags_Logarithmic instead of using the old 'float power' function!".
|
||||
"Call Drag function with ImGuiSliderFlags_Logarithmic instead of using the old 'float power' function!".
|
||||
- In case asserts are disabled, the code will not crash and enable the _Logarithmic flag.
|
||||
- You can replace the >1.0f value with ImGuiDragFlags_Logarithmic or ImGuiSliderFlags_Logarithmic
|
||||
to fix the warning/assert and get a _similar_ effect as previous uses of power >1.0f.
|
||||
- You can replace the >1.0f value with ImGuiSliderFlags_Logarithmic to fix the warning/assert
|
||||
and get a _similar_ effect as previous uses of power >1.0f.
|
||||
See https://github.com/ocornut/imgui/issues/3361 for all details.
|
||||
Kept inline redirection functions (will obsolete) apart for: DragFloatRange2(), VSliderFloat(), VSliderScalar().
|
||||
For those three the 'float power=1.0f' version was removed directly as they were most unlikely ever used.
|
||||
@ -70,18 +69,18 @@ Other Changes:
|
||||
flag being cleared accordingly. (bug introduced in 1.77 WIP on 2020/06/16) (#3344, #2880)
|
||||
- Window: Fixed clicking over an item which hovering has been disabled (e.g inhibited by a popup)
|
||||
from marking the window as moved.
|
||||
- Drag, Slider: Added ImGuiDragFlags and ImGuiSliderFlags parameters.
|
||||
- Drag, Slider: ImGuiSliderFlags parameters.
|
||||
For float functions they replace the old trailing 'float power=1.0' parameter.
|
||||
(See #3361 and the "Breaking Changes" block above for all details).
|
||||
- Drag, Slider: Added ImGuiDragFlags_Logarithmic/ImGuiSliderFlags_Logarithmic flags to
|
||||
enable logarithmic editing (generally more precision around zero), as a replacement to the old
|
||||
'float power' parameter which was obsoleted. (#1823, #1316, #642) [@Shironekoben, @AndrewBelt]
|
||||
- Drag, Slider: Added ImGuiDragFlags_ClampOnInput/ImGuiSliderFlags_ClampOnInput flags to force
|
||||
clamping value when using CTRL+Click to type in a value manually. (#1829, #3209, #946, #413).
|
||||
- Drag, Slider: Added ImGuiDragFlags_NoRoundToFormat/ImGuiSliderFlags_NoRoundToFormat flags
|
||||
to disable rounding underlying value to match precision of the display format string. (#642)
|
||||
- Drag, Slider: Added ImGuiDragFlags_NoInput/ImGuiSliderFlags_NoInput to disable turning
|
||||
widget into a text input with CTRL+Click or Nav Enter.
|
||||
- Drag, Slider: Added ImGuiSliderFlags_Logarithmic flags to enable logarithmic editing
|
||||
(generally more precision around zero), as a replacement to the old 'float power' parameter
|
||||
which was obsoleted. (#1823, #1316, #642) [@Shironekoben, @AndrewBelt]
|
||||
- Drag, Slider: Added ImGuiSliderFlags_ClampOnInput flags to force clamping value when using
|
||||
CTRL+Click to type in a value manually. (#1829, #3209, #946, #413).
|
||||
- Drag, Slider: Added ImGuiSliderFlags_NoRoundToFormat flags to disable rounding underlying
|
||||
value to match precision of the display format string. (#642)
|
||||
- Drag, Slider: Added ImGuiSliderFlags_NoInput to disable turning widget into a text input
|
||||
with CTRL+Click or Nav Enter.
|
||||
- Nav, Slider: Fix using keyboard/gamepad controls with certain logarithmic sliders where
|
||||
pushing a direction near zero values would be cancelled out. [@Shironekoben]
|
||||
- DragFloatRange2, DragIntRange2: Fixed an issue allowing to drag out of bounds when both
|
||||
|
Reference in New Issue
Block a user