mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Fixed repeating button behavior triggering twice, typically affect the +/- of InputInt/InputFloat and user repeating buttons (#656)
+ Took note of further work
Broken in 547f34cf22
This commit is contained in:
parent
a2a5d71582
commit
e1e2752dcb
@ -5357,7 +5357,11 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|||||||
pressed = true;
|
pressed = true;
|
||||||
SetActiveID(0);
|
SetActiveID(0);
|
||||||
}
|
}
|
||||||
if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && ImGui::IsMouseClicked(0, true))
|
|
||||||
|
// 'Repeat' mode acts when held regardless of _PressedOn flags
|
||||||
|
// FIXME: Need to clarify the repeat behavior with those differents flags. Currently the typical PressedOnClickRelease+Repeat will add an extra click on final release (hardly noticeable with repeat rate, but technically an issue)
|
||||||
|
// Relies on repeat behavior of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings.
|
||||||
|
if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && g.IO.MouseDownDuration[0] > 0.0f && ImGui::IsMouseClicked(0, true))
|
||||||
pressed = true;
|
pressed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user