Skip to content

Commit

Permalink
Fixed not being able to move a window by clicking on one of its child…
Browse files Browse the repository at this point in the history
… window (#1337, #635), broken by 313d388
  • Loading branch information
ocornut committed Sep 27, 2017
1 parent 8374a45 commit e56eba4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2230,15 +2230,12 @@ void ImGui::NewFrame()
{
KeepAliveID(g.MovedWindowMoveId);
IM_ASSERT(g.MovedWindow && g.MovedWindow->RootWindow);
IM_ASSERT(g.MovedWindow->RootWindow->MoveId == g.MovedWindowMoveId);
IM_ASSERT(g.MovedWindow->MoveId == g.MovedWindowMoveId);
if (g.IO.MouseDown[0])
{
if (!(g.MovedWindow->Flags & ImGuiWindowFlags_NoMove))
{
g.MovedWindow->PosFloat += g.IO.MouseDelta;
if (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f)
MarkIniSettingsDirty(g.MovedWindow);
}
g.MovedWindow->RootWindow->PosFloat += g.IO.MouseDelta;
if (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f)
MarkIniSettingsDirty(g.MovedWindow->RootWindow);
FocusWindow(g.MovedWindow);
}
else
Expand Down Expand Up @@ -2704,7 +2701,7 @@ void ImGui::EndFrame()
if (!(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove))
{
g.MovedWindow = g.HoveredWindow;
g.MovedWindowMoveId = g.HoveredRootWindow->MoveId;
g.MovedWindowMoveId = g.HoveredWindow->MoveId;
SetActiveID(g.MovedWindowMoveId, g.HoveredRootWindow);
}
}
Expand Down

0 comments on commit e56eba4

Please sign in to comment.