Fixed outline breaking for zones (points were not always created in the double click point).
This commit is contained in:
parent
cc445391e9
commit
c5b65e1ec4
|
@ -338,6 +338,7 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
|
|||
controls->ShowCursor( false );
|
||||
controls->SetAutoPan( false );
|
||||
controls->SetSnapping( false );
|
||||
controls->ForceCursorPosition( false );
|
||||
}
|
||||
|
||||
setTransitions();
|
||||
|
@ -672,9 +673,9 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
|
|||
VECTOR2I( outline->GetPos( nextNearestIdx ) ) );
|
||||
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 );
|
||||
if( distance < nearestDist )
|
||||
|
|
Loading…
Reference in New Issue