Viewports: rework viewport's WorkOffset (positive top-left, negative top-right0 into WorkInset (positive everywhere). (#7823)

This commit is contained in:
ocornut
2024-08-01 19:04:46 +02:00
parent 139e99ca37
commit cfd23957fb
3 changed files with 21 additions and 16 deletions

View File

@@ -8559,9 +8559,9 @@ bool ImGui::BeginViewportSideBar(const char* name, ImGuiViewport* viewport_p, Im
// Report our size into work area (for next frame) using actual window size
if (dir == ImGuiDir_Up || dir == ImGuiDir_Left)
viewport->BuildWorkOffsetMin[axis] += axis_size;
viewport->BuildWorkInsetMin[axis] += axis_size;
else if (dir == ImGuiDir_Down || dir == ImGuiDir_Right)
viewport->BuildWorkOffsetMax[axis] -= axis_size;
viewport->BuildWorkInsetMax[axis] += axis_size;
}
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDocking;