Legacy mode: Pan with mouse middle button fix an unwanted displacement of the drawings (half width of scroll bars) when starting the pan (due to a parameter (new reference position of scroll bars in IU) which was stored with an incorrect value)
Minor enhancement during pan: the mouse cursor shape is modified.
This commit is contained in:
parent
e0a7f0041a
commit
cdf2b6950e
|
@ -1035,10 +1035,11 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
double unitsX = virtualSizeIU.x * scale;
|
double unitsX = virtualSizeIU.x * scale;
|
||||||
double unitsY = virtualSizeIU.y * scale;
|
double unitsY = virtualSizeIU.y * scale;
|
||||||
|
|
||||||
|
// Store the requested center position for later use
|
||||||
|
SetScrollCenterPosition( aCenterPositionIU );
|
||||||
|
|
||||||
// Calculate the scroll bar position in internal units to place the
|
// Calculate the scroll bar position in internal units to place the
|
||||||
// center position at the center of client rectangle.
|
// center position at the center of client rectangle.
|
||||||
SetScrollCenterPosition( centerPositionIU );
|
|
||||||
|
|
||||||
double posX = centerPositionIU.x - clientRectIU.GetWidth() / 2.0 - screen->m_DrawOrg.x;
|
double posX = centerPositionIU.x - clientRectIU.GetWidth() / 2.0 - screen->m_DrawOrg.x;
|
||||||
double posY = centerPositionIU.y - clientRectIU.GetHeight() / 2.0 - screen->m_DrawOrg.y;
|
double posY = centerPositionIU.y - clientRectIU.GetHeight() / 2.0 - screen->m_DrawOrg.y;
|
||||||
|
|
||||||
|
|
|
@ -1152,12 +1152,14 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
|
||||||
|
|
||||||
INSTALL_UNBUFFERED_DC( dc, this );
|
INSTALL_UNBUFFERED_DC( dc, this );
|
||||||
CrossHairOff( &dc );
|
CrossHairOff( &dc );
|
||||||
|
SetCursor( wxCURSOR_SIZING );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( event.ButtonUp( wxMOUSE_BTN_MIDDLE ) && m_enableMiddleButtonPan )
|
if( event.ButtonUp( wxMOUSE_BTN_MIDDLE ) && m_enableMiddleButtonPan )
|
||||||
{
|
{
|
||||||
INSTALL_UNBUFFERED_DC( dc, this );
|
INSTALL_UNBUFFERED_DC( dc, this );
|
||||||
CrossHairOn( &dc );
|
CrossHairOn( &dc );
|
||||||
|
SetCursor( (wxStockCursor) m_currentCursor );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( event.MiddleIsDown() && m_enableMiddleButtonPan )
|
if( event.MiddleIsDown() && m_enableMiddleButtonPan )
|
||||||
|
|
Loading…
Reference in New Issue