mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-22 06:22:58 +02:00
Bug 1896 - Linux: Resizing the device toolbar judders badly
This commit is contained in:
@@ -164,7 +164,10 @@ void ToolBarResizer::OnLeftDown( wxMouseEvent & event )
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
|
|
||||||
// Retrieve the mouse position
|
// Retrieve the mouse position
|
||||||
mResizeOffset = ClientToScreen( event.GetPosition() )-mBar->GetRect().GetBottomRight();
|
// Bug 1896: This is at time of processing the event, rather than at time
|
||||||
|
// of generation of event. Works around event.GetPosition() giving
|
||||||
|
// incorrect values if position of resizer is changing.
|
||||||
|
mResizeOffset = wxGetMousePosition()-mBar->GetRect().GetBottomRight();
|
||||||
|
|
||||||
mOrigSize = mBar->GetSize();
|
mOrigSize = mBar->GetSize();
|
||||||
|
|
||||||
@@ -209,18 +212,19 @@ void ToolBarResizer::OnMotion( wxMouseEvent & event )
|
|||||||
// Go ahead and set the event to propagate
|
// Go ahead and set the event to propagate
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
|
||||||
// Retrieve the mouse position
|
|
||||||
wxPoint raw_pos = event.GetPosition();
|
|
||||||
wxPoint pos = ClientToScreen( raw_pos );
|
|
||||||
|
|
||||||
if( HasCapture() && event.Dragging() )
|
if( HasCapture() && event.Dragging() )
|
||||||
{
|
{
|
||||||
|
// Retrieve the mouse position
|
||||||
|
// Bug 1896: This is at time of processing the event, rather than at time
|
||||||
|
// of generation of event. Works around event.GetPosition() giving
|
||||||
|
// incorrect values if position of resizer is changing.
|
||||||
|
wxPoint pos = wxGetMousePosition();
|
||||||
|
|
||||||
wxRect r = mBar->GetRect();
|
wxRect r = mBar->GetRect();
|
||||||
wxSize msz = mBar->GetMinSize();
|
wxSize msz = mBar->GetMinSize();
|
||||||
wxSize psz = mBar->GetParent()->GetClientSize();
|
wxSize psz = mBar->GetParent()->GetClientSize();
|
||||||
|
|
||||||
// Adjust the size by the difference between the
|
// Adjust the size based on updated mouse position.
|
||||||
// last mouse and current mouse positions.
|
|
||||||
r.width = ( pos.x - mResizeOffset.x ) - r.x;
|
r.width = ( pos.x - mResizeOffset.x ) - r.x;
|
||||||
|
|
||||||
// Constrain
|
// Constrain
|
||||||
|
Reference in New Issue
Block a user