Internals: Removed misleading ImRect::FixInverted + fix minor formatting in Readme.

Demo: Fixed Overlay: Added a context menu item to enable freely moving the window.
This commit is contained in:
omar
2018-04-23 21:38:53 +02:00
parent 7b6b7038c5
commit dc03c93164
5 changed files with 14 additions and 8 deletions

View File

@ -5568,7 +5568,8 @@ static void ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au
// Using the FlattenChilds button flag we make the resize button accessible even if we are hovering over a child window
ImRect resize_rect(corner, corner + grip.InnerDir * grip_hover_size);
resize_rect.FixInverted();
if (resize_rect.Min.x > resize_rect.Max.x) ImSwap(resize_rect.Min.x, resize_rect.Max.x);
if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y);
bool hovered, held;
ButtonBehavior(resize_rect, window->GetID((void*)(intptr_t)resize_grip_n), &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
if (hovered || held)