Commit 3dc9f295 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Fixed cursor force position option.

parent 84c496e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
        // but changes in world coordinates (e.g. autopanning)
        type == KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE )
    {
        VECTOR2D screenPos = m_toolMgr->GetViewControls()->GetCursorPosition();
        VECTOR2D screenPos = m_toolMgr->GetViewControls()->GetMousePosition();
        VECTOR2D pos = getView()->ToWorld( screenPos );

        if( pos != m_lastMousePos || type == KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE )
+0 −11
Original line number Diff line number Diff line
@@ -83,9 +83,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
    bool isAutoPanning = false;

    if( m_autoPanEnabled )
    {
        isAutoPanning = handleAutoPanning( aEvent );
    }

    if( !isAutoPanning && aEvent.Dragging() )
    {
@@ -243,15 +241,6 @@ const VECTOR2D WX_VIEW_CONTROLS::GetMousePosition() const
}


const VECTOR2D WX_VIEW_CONTROLS::GetCursorPosition() const
{
    if( m_snappingEnabled )
        return m_view->GetGAL()->GetGridPoint( GetMousePosition() );
    else
        return GetMousePosition();
}


bool WX_VIEW_CONTROLS::handleAutoPanning( const wxMouseEvent& aEvent )
{
    VECTOR2D p( aEvent.GetX(), aEvent.GetY() );
+4 −1
Original line number Diff line number Diff line
@@ -84,7 +84,10 @@ public:
    const VECTOR2D GetMousePosition() const;

    /// @copydoc VIEW_CONTROLS::GetCursorPosition()
    const VECTOR2D GetCursorPosition() const;
    const VECTOR2D GetCursorPosition() const
    {
        return m_cursorPosition;
    }

    /// Event that forces mouse move event in the dispatcher (eg. used in autopanning, when mouse
    /// cursor does not move in screen coordinates, but does in world coordinates)