3D Viewer: Fix mouse panning in orthographic projection mode
Fixes https://gitlab.com/kicad/code/kicad/issues/5561
This commit is contained in:
parent
846e4aed42
commit
744e70df36
|
@ -97,10 +97,10 @@ void TRACK_BALL::Pan( const wxPoint& aNewMousePosition )
|
|||
|
||||
if( m_projectionType == PROJECTION_TYPE::ORTHO )
|
||||
{
|
||||
// With the orthographic projection, there is just a zoom factor
|
||||
const float panFactor = m_zoom / 37.5f; // Magic number from CAMERA::rebuildProjection
|
||||
m_camera_pos.x -= panFactor * ( m_lastPosition.x - aNewMousePosition.x );
|
||||
m_camera_pos.y -= panFactor * ( aNewMousePosition.y - m_lastPosition.y );
|
||||
m_camera_pos.x -= m_frustum.nw *
|
||||
( m_lastPosition.x - aNewMousePosition.x ) / m_windowSize.x;
|
||||
m_camera_pos.y -= m_frustum.nh *
|
||||
( aNewMousePosition.y - m_lastPosition.y ) / m_windowSize.y;
|
||||
}
|
||||
else // PROJECTION_TYPE::PERSPECTIVE
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue