mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-15 00:44:20 +00:00
ButtonBehavior: Fixed ImGuiButtonFlags_NoHoldingActiveID from incorrectly setting ActiveIdClickOffset, which probably have no known effect, but it is more correct this way. (#1418)
This commit is contained in:
parent
aae52522c3
commit
41862b8c0e
1 changed files with 5 additions and 1 deletions
|
|
@ -5835,11 +5835,15 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|||
{
|
||||
pressed = true;
|
||||
if (flags & ImGuiButtonFlags_NoHoldingActiveID)
|
||||
{
|
||||
ClearActiveID();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetActiveID(id, window); // Hold on ID
|
||||
g.ActiveIdClickOffset = g.IO.MousePos - bb.Min;
|
||||
}
|
||||
FocusWindow(window);
|
||||
g.ActiveIdClickOffset = g.IO.MousePos - bb.Min;
|
||||
}
|
||||
if ((flags & ImGuiButtonFlags_PressedOnRelease) && g.IO.MouseReleased[0])
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue