1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-23 23:03:55 +02:00

Much easier to dock with an empty dock now.

Overlapping a dock is now enough to trigger docking.  Previously the top left corner had to be in the dock.
This commit is contained in:
james.k.crook@gmail.com
2014-11-02 17:39:50 +00:00
parent a0ff55faa9
commit 799230b882
3 changed files with 12 additions and 14 deletions

View File

@@ -1033,16 +1033,15 @@ void ToolManager::OnMouse( wxMouseEvent & event )
// lands back where we started.
pos += wxPoint( 5, 20 );
// Is mouse pointer within either dock?
// To find which dock, rather than test against pos, test against the whole dragger rect.
// This means it is enough to overlap the dock to dock with it.
wxRect barRect = mDragWindow->GetRect();
ToolDock *dock = NULL;
if( tr.Contains( pos ) )
{
if( tr.Intersects( barRect ) )
dock = mTopDock;
}
else if( br.Contains( pos ) )
{
else if( br.Intersects( barRect ) )
dock = mBotDock;
}
// Looks like we have a winner...
if( dock )
@@ -1050,7 +1049,6 @@ void ToolManager::OnMouse( wxMouseEvent & event )
wxPoint p;
wxRect r;
// Calculate where the bar would be placed
mDragBefore = dock->PositionBar( mDragBar, pos, r );