Skip to content

Commit

Permalink
Fix window header disappear when dragging window in certain scenarios.
Browse files Browse the repository at this point in the history
Signed-off-by: iysheng <[email protected]>
  • Loading branch information
iysheng committed May 21, 2023
1 parent 2ee903c commit 331af63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ bool Window::mouse_drag_event(const Vector2i &, const Vector2i &rel,
if (m_drag && (button & (1 << GLFW_MOUSE_BUTTON_1)) != 0) {
m_pos += rel;
m_pos = max(m_pos, Vector2i(0));
m_pos = min(m_pos, parent()->size() - m_size);
if (parent()->size().y() > m_size.y())
m_pos = min(m_pos, parent()->size() - m_size);
return true;
}
return false;
Expand Down

0 comments on commit 331af63

Please sign in to comment.