diff --git a/eeschema/tools/ee_point_editor.cpp b/eeschema/tools/ee_point_editor.cpp index b3244e25be..edcf20e685 100644 --- a/eeschema/tools/ee_point_editor.cpp +++ b/eeschema/tools/ee_point_editor.cpp @@ -841,7 +841,7 @@ bool EE_POINT_EDITOR::addCornerCondition( const SELECTION& ) VECTOR2I cursorPos = getViewControls()->GetCursorPosition(); double threshold = getView()->ToWorld( EDIT_POINT::POINT_SIZE ); - return shape->HitTest( mapCoords( cursorPos ), (int) threshold ); + return shape->HitTest( (wxPoint) cursorPos, (int) threshold ); } @@ -854,14 +854,13 @@ int EE_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) SHAPE_LINE_CHAIN& poly = shape->GetPolyShape().Outline( 0 ); VECTOR2I cursor = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() ); - wxPoint pos = mapCoords( cursor ); int currentMinDistance = INT_MAX; int closestLineStart = 0; for( unsigned i = 0; i < poly.GetPointCount() - 1; ++i ) { int distance = (int) DistanceLinePoint( (wxPoint) poly.CPoint( i ), - (wxPoint) poly.CPoint( i + 1 ), pos ); + (wxPoint) poly.CPoint( i + 1 ), (wxPoint) cursor ); if( distance < currentMinDistance ) { @@ -871,7 +870,7 @@ int EE_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) } saveItemsToUndo(); - poly.Insert( closestLineStart, pos ); + poly.Insert( closestLineStart, (wxPoint) cursor ); updateItem( shape, true ); updatePoints();