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

Fixed cursor force position option.

parent 84c496e1
...@@ -221,7 +221,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) ...@@ -221,7 +221,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
// but changes in world coordinates (e.g. autopanning) // but changes in world coordinates (e.g. autopanning)
type == KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE ) 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 ); VECTOR2D pos = getView()->ToWorld( screenPos );
if( pos != m_lastMousePos || type == KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE ) if( pos != m_lastMousePos || type == KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE )
......
...@@ -83,9 +83,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent ) ...@@ -83,9 +83,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
bool isAutoPanning = false; bool isAutoPanning = false;
if( m_autoPanEnabled ) if( m_autoPanEnabled )
{
isAutoPanning = handleAutoPanning( aEvent ); isAutoPanning = handleAutoPanning( aEvent );
}
if( !isAutoPanning && aEvent.Dragging() ) if( !isAutoPanning && aEvent.Dragging() )
{ {
...@@ -243,15 +241,6 @@ const VECTOR2D WX_VIEW_CONTROLS::GetMousePosition() const ...@@ -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 ) bool WX_VIEW_CONTROLS::handleAutoPanning( const wxMouseEvent& aEvent )
{ {
VECTOR2D p( aEvent.GetX(), aEvent.GetY() ); VECTOR2D p( aEvent.GetX(), aEvent.GetY() );
......
...@@ -84,7 +84,10 @@ public: ...@@ -84,7 +84,10 @@ public:
const VECTOR2D GetMousePosition() const; const VECTOR2D GetMousePosition() const;
/// @copydoc VIEW_CONTROLS::GetCursorPosition() /// @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 /// 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) /// cursor does not move in screen coordinates, but does in world coordinates)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment