mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 09:27:00 +00:00
Viewport: Moving a window accross viewports tries to preserve the dragging pivot (that is assuming that the window will be evenly scaled by DPI, aka Style is scaled). (#1542)
This commit is contained in:
parent
9d8bc79025
commit
c23b5463c7
10
imgui.cpp
10
imgui.cpp
@ -13982,11 +13982,17 @@ static void ScaleWindow(ImGuiWindow* window, float scale)
|
||||
void ImGui::ScaleWindowsInViewport(ImGuiViewportP* viewport, float scale)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
||||
if (g.MovingWindow != NULL)
|
||||
g.ActiveIdClickOffset = ImFloor(g.ActiveIdClickOffset * scale);
|
||||
/*
|
||||
if (g.IO.MousePosViewport == viewport->ID)
|
||||
{
|
||||
//g.IO.MousePos = g.IO.MousePosPrev = ImFloor((g.IO.MousePos - viewport->Pos) * scale) + viewport->Pos;
|
||||
//g.IO.MouseDelta = ImVec2(0,0);
|
||||
g.IO.MousePos = g.IO.MousePosPrev = ImFloor((g.IO.MousePos - viewport->Pos) * scale) + viewport->Pos;
|
||||
g.IO.MouseDelta = ImVec2(0,0);
|
||||
}
|
||||
*/
|
||||
|
||||
if (viewport->Window)
|
||||
{
|
||||
ScaleWindow(viewport->Window, scale);
|
||||
|
Loading…
Reference in New Issue
Block a user