Commit bf418eb1 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Cursor coordinates are updated in GAL canvases.

parent 2d8dc046
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@

#include <wx/fontdlg.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <gal/graphics_abstraction_layer.h>

/**
@@ -1019,10 +1020,19 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
wxPoint EDA_DRAW_FRAME::GetCrossHairPosition( bool aInvertY ) const
{
    // subject to change, borrow from old BASE_SCREEN for now.
    if( IsGalCanvasActive() )
    {
        VECTOR2I cursor = GetGalCanvas()->GetViewControls()->GetCursorPosition();
        cursor = GetGalCanvas()->GetGAL()->GetGridPoint( cursor );

        return wxPoint( cursor.x, cursor.y );
    }
    else
    {
        BASE_SCREEN* screen = GetScreen();  // virtual call
        return screen->getCrossHairPosition( aInvertY );
    }
}


void EDA_DRAW_FRAME::SetCrossHairPosition( const wxPoint& aPosition, bool aSnapToGrid )
+1 −0
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
        {
            motion = true;
            m_lastMousePos = pos;
            m_editFrame->UpdateStatusBar();
        }

        for( unsigned int i = 0; i < m_buttons.size(); i++ )