mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +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
@ -5835,11 +5835,15 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|||||||
{
|
{
|
||||||
pressed = true;
|
pressed = true;
|
||||||
if (flags & ImGuiButtonFlags_NoHoldingActiveID)
|
if (flags & ImGuiButtonFlags_NoHoldingActiveID)
|
||||||
|
{
|
||||||
ClearActiveID();
|
ClearActiveID();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
SetActiveID(id, window); // Hold on ID
|
SetActiveID(id, window); // Hold on ID
|
||||||
|
g.ActiveIdClickOffset = g.IO.MousePos - bb.Min;
|
||||||
|
}
|
||||||
FocusWindow(window);
|
FocusWindow(window);
|
||||||
g.ActiveIdClickOffset = g.IO.MousePos - bb.Min;
|
|
||||||
}
|
}
|
||||||
if ((flags & ImGuiButtonFlags_PressedOnRelease) && g.IO.MouseReleased[0])
|
if ((flags & ImGuiButtonFlags_PressedOnRelease) && g.IO.MouseReleased[0])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user