Commit c5b65e1e authored by Maciej Suminski's avatar Maciej Suminski

Fixed outline breaking for zones (points were not always created in the double click point).

parent cc445391
...@@ -338,6 +338,7 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent ) ...@@ -338,6 +338,7 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
controls->ShowCursor( false ); controls->ShowCursor( false );
controls->SetAutoPan( false ); controls->SetAutoPan( false );
controls->SetSnapping( false ); controls->SetSnapping( false );
controls->ForceCursorPosition( false );
} }
setTransitions(); setTransitions();
...@@ -672,9 +673,9 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint ) ...@@ -672,9 +673,9 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
VECTOR2I( outline->GetPos( nextNearestIdx ) ) ); VECTOR2I( outline->GetPos( nextNearestIdx ) ) );
unsigned int nearestDist = side.Distance( aBreakPoint ); unsigned int nearestDist = side.Distance( aBreakPoint );
for( int i = 0; i < outline->GetCornersCount() - 2; ++i ) for( int i = 0; i < outline->GetCornersCount() - 1; ++i )
{ {
SEG side( VECTOR2I( outline->GetPos( i ) ), VECTOR2I( outline->GetPos( i + 1 ) ) ); side = SEG( VECTOR2I( outline->GetPos( i ) ), VECTOR2I( outline->GetPos( i + 1 ) ) );
unsigned int distance = side.Distance( aBreakPoint ); unsigned int distance = side.Distance( aBreakPoint );
if( distance < nearestDist ) if( distance < nearestDist )
......
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