Skip to content

Commit

Permalink
Finish work on bordeless_movable
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jan 1, 2024
1 parent a889c25 commit 4e77dc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hello_imgui/internal/borderless_movable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ namespace HelloImGui
// Update dragging state
ImVec2 mousePos = ImGui::GetMousePos();
static bool isDragging = false;
if (dragArea.Contains(mousePos) && !isDragging && ImGui::IsMouseDragging(ImGuiMouseButton_Left))
if (dragArea.Contains(mousePos) && !isDragging && ImGui::IsMouseDown(ImGuiMouseButton_Left))
{
isDragging = true;
}
if (!ImGui::IsMouseDragging(ImGuiMouseButton_Left) && isDragging)
if (!ImGui::IsMouseDown(ImGuiMouseButton_Left) && isDragging)
isDragging = false;

// Draw drag zone
Expand Down Expand Up @@ -70,9 +70,9 @@ namespace HelloImGui
// Update dragging state
static bool isDragging = false;
ImVec2 mousePos = ImGui::GetIO().MousePos;
if (dragArea.Contains(mousePos) && !isDragging && ImGui::IsMouseDragging(ImGuiMouseButton_Left))
if (dragArea.Contains(mousePos) && !isDragging && ImGui::IsMouseDown(ImGuiMouseButton_Left))
isDragging = true;
if (!ImGui::IsMouseDragging(ImGuiMouseButton_Left))
if (!ImGui::IsMouseDown(ImGuiMouseButton_Left))
isDragging = false;

// Draw drag zone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,11 @@ int main(int, char**)
runnerParams.imGuiWindowParams.menuAppTitle = "Docking Demo";
runnerParams.appWindowParams.windowGeometry.size = {1000, 900};
runnerParams.appWindowParams.restorePreviousGeometry = true;

// Our application uses a borderless window, but is movable/resizable
runnerParams.appWindowParams.borderless = true;
runnerParams.appWindowParams.borderlessMovable = true;
runnerParams.appWindowParams.borderlessResizable = true;

// Load additional font
runnerParams.callbacks.LoadAdditionalFonts = LoadFonts;
Expand Down

0 comments on commit 4e77dc8

Please sign in to comment.