Fix touchpad scrolling with mousewheelPan
Fixes: lp:1735669 * https://bugs.launchpad.net/kicad/+bug/1735669
This commit is contained in:
parent
0dad728e86
commit
ee56e21f81
|
@ -996,25 +996,31 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
|
||||||
cmd.SetId( ID_POPUP_ZOOM_OUT );
|
cmd.SetId( ID_POPUP_ZOOM_OUT );
|
||||||
}
|
}
|
||||||
// MousewheelPAN + Shift = horizontal scrolling
|
// MousewheelPAN + Shift = horizontal scrolling
|
||||||
else if( event.ShiftDown() && !event.ControlDown() )
|
|
||||||
{
|
|
||||||
if( wheelRotation > 0 )
|
|
||||||
cmd.SetId( ID_PAN_LEFT );
|
|
||||||
else if( wheelRotation < 0)
|
|
||||||
cmd.SetId( ID_PAN_RIGHT );
|
|
||||||
}
|
|
||||||
// Without modifiers MousewheelPAN - just pan
|
// Without modifiers MousewheelPAN - just pan
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxPoint newStart = GetViewStart();
|
if( event.ShiftDown() && !event.ControlDown() )
|
||||||
if( axis == wxMOUSE_WHEEL_HORIZONTAL )
|
axis = wxMOUSE_WHEEL_HORIZONTAL;
|
||||||
newStart.x += wheelRotation;
|
|
||||||
else
|
|
||||||
newStart.y -= wheelRotation;
|
|
||||||
|
|
||||||
wxPoint center = GetScreenCenterLogicalPosition();
|
wxPoint newStart = GetViewStart();
|
||||||
GetParent()->SetScrollCenterPosition( center );
|
wxPoint center = GetParent()->GetScrollCenterPosition();
|
||||||
|
double scale = GetParent()->GetScreen()->GetScalingFactor();
|
||||||
|
|
||||||
|
if( axis == wxMOUSE_WHEEL_HORIZONTAL )
|
||||||
|
{
|
||||||
|
newStart.x += wheelRotation;
|
||||||
|
center.x += KiROUND( (double) wheelRotation / scale );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newStart.y -= wheelRotation;
|
||||||
|
center.y -= KiROUND( (double) wheelRotation / scale );
|
||||||
|
}
|
||||||
Scroll( newStart );
|
Scroll( newStart );
|
||||||
|
|
||||||
|
GetParent()->SetScrollCenterPosition( center );
|
||||||
|
GetParent()->SetCrossHairPosition( center, true );
|
||||||
|
GetParent()->RedrawScreen( center, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( wheelRotation > 0 )
|
else if( wheelRotation > 0 )
|
||||||
|
|
Loading…
Reference in New Issue