X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3deeefebd7042650d3aa92ed3d85eb9715238dc0..3baaf31317b1380ba9f33f8a23ff04bd20356d63:/src/univ/themes/win32.cpp diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index 85b7729436..911234b009 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -3153,7 +3153,7 @@ int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int fla btnRect.x -= FRAME_BUTTON_WIDTH; } - if ( pt.y < client.y + FRAME_TITLEBAR_HEIGHT ) + if ( pt.y >= client.y && pt.y < client.y + FRAME_TITLEBAR_HEIGHT ) return wxHT_TOPLEVEL_TITLEBAR; } @@ -3161,17 +3161,15 @@ int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int fla { // we are certainly at one of borders, lets decide which one: - wxCoord midX = client.x + client.width/2, - midY = client.y + client.height/2; int border = 0; // dirty trick, relies on the way wxHT_TOPLEVEL_XXX are defined! - if ( pt.x < midX ) + if ( pt.x < client.x ) border |= wxHT_TOPLEVEL_BORDER_W; - else + else if ( pt.x >= client.width + client.x ) border |= wxHT_TOPLEVEL_BORDER_E; - if ( pt.y < midY ) + if ( pt.y < client.y ) border |= wxHT_TOPLEVEL_BORDER_N; - else + else if ( pt.y >= client.height + client.y ) border |= wxHT_TOPLEVEL_BORDER_S; return border; }