Fix polygon point editor behavior to avoid hard limits

When dragging a vertex, use the 45/90 limits as guides and display the
full guidelines.  When dragging a midpoint, do not use these limits.
Keep the standard converging limit
This commit is contained in:
Seth Hillbrand
2025-10-10 13:31:49 -07:00
parent cc245475c5
commit 3a67dceab2
7 changed files with 146 additions and 8 deletions
+3 -3
View File
@@ -52,7 +52,7 @@ void POLYGON_POINT_EDIT_BEHAVIOR::BuildForPolyOutline( EDIT_POINTS& aPo
else
aPoints.AddLine( aPoints.Point( i ), aPoints.Point( i + 1 ) );
aPoints.Line( i ).SetConstraint( new EC_PERPLINE( aPoints.Line( i ) ) );
aPoints.Line( i ).SetConstraint( new EC_CONVERGING( aPoints.Line( i ), aPoints ) );
}
// The last missing line, connecting the last and the first polygon point
@@ -60,7 +60,7 @@ void POLYGON_POINT_EDIT_BEHAVIOR::BuildForPolyOutline( EDIT_POINTS& aPo
aPoints.Point( aPoints.GetContourStartIdx( cornersCount - 1 ) ) );
aPoints.Line( aPoints.LinesSize() - 1 )
.SetConstraint( new EC_PERPLINE( aPoints.Line( aPoints.LinesSize() - 1 ) ) );
.SetConstraint( new EC_CONVERGING( aPoints.Line( aPoints.LinesSize() - 1 ), aPoints ) );
}
@@ -94,7 +94,7 @@ void POLYGON_POINT_EDIT_BEHAVIOR::UpdateOutlineFromPoints( SHAPE_POLY_SET& aOu
for( unsigned i = 0; i < aPoints.LinesSize(); ++i )
{
if( !isModified( aEditedPoint, aPoints.Line( i ) ) )
aPoints.Line( i ).SetConstraint( new EC_PERPLINE( aPoints.Line( i ) ) );
aPoints.Line( i ).SetConstraint( new EC_CONVERGING( aPoints.Line( i ), aPoints ) );
}
}