mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Clarifying that MovedWindow* apply to mouse moving only
This commit is contained in:
parent
f2d1472481
commit
4309b8c1ed
@ -2655,8 +2655,8 @@ void ImGui::NewFrame()
|
|||||||
g.FramerateSecPerFrameIdx = (g.FramerateSecPerFrameIdx + 1) % IM_ARRAYSIZE(g.FramerateSecPerFrame);
|
g.FramerateSecPerFrameIdx = (g.FramerateSecPerFrameIdx + 1) % IM_ARRAYSIZE(g.FramerateSecPerFrame);
|
||||||
g.IO.Framerate = 1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame));
|
g.IO.Framerate = 1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame));
|
||||||
|
|
||||||
// Handle user moving window (at the beginning of the frame to avoid input lag or sheering). Only valid for root windows.
|
// Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering). Only valid for root windows.
|
||||||
if (g.MovedWindowMoveId && g.MovedWindowMoveId == g.ActiveId)
|
if (g.MovedWindowMoveId && g.MovedWindowMoveId == g.ActiveId && g.ActiveIdSource == ImGuiInputSource_Mouse)
|
||||||
{
|
{
|
||||||
KeepAliveID(g.MovedWindowMoveId);
|
KeepAliveID(g.MovedWindowMoveId);
|
||||||
IM_ASSERT(g.MovedWindow && g.MovedWindow->RootWindow);
|
IM_ASSERT(g.MovedWindow && g.MovedWindow->RootWindow);
|
||||||
|
@ -393,7 +393,7 @@ struct ImGuiContext
|
|||||||
ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
|
ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
|
||||||
ImGuiWindow* ActiveIdWindow;
|
ImGuiWindow* ActiveIdWindow;
|
||||||
ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard)
|
ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard)
|
||||||
ImGuiWindow* MovedWindow; // Track the child window we clicked on to move a window.
|
ImGuiWindow* MovedWindow; // Track the child window we clicked on to move a window (only apply to moving with mouse)
|
||||||
ImGuiID MovedWindowMoveId; // == MovedWindow->RootWindow->MoveId
|
ImGuiID MovedWindowMoveId; // == MovedWindow->RootWindow->MoveId
|
||||||
ImVector<ImGuiIniData> Settings; // .ini Settings
|
ImVector<ImGuiIniData> Settings; // .ini Settings
|
||||||
float SettingsDirtyTimer; // Save .ini Settings on disk when time reaches zero
|
float SettingsDirtyTimer; // Save .ini Settings on disk when time reaches zero
|
||||||
|
Loading…
Reference in New Issue
Block a user