File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -360,19 +360,22 @@ void BezierOffsetApp::mouseDown( MouseEvent event )
360360 return ;
361361 }
362362
363- // Add points - add to last contour
363+ // Add points - add to last contour (or start new one if closed)
364364 if ( getActiveShape ().empty () ) {
365365 // Empty shape - start a new path
366366 getActiveShape ().moveTo ( pos );
367367 mTrackedPoint = 0 ;
368368 updateResult ();
369369 }
370370 else {
371- // Add to last contour
372371 Path2d& lastContour = getActiveShape ().getContours ().back ();
373372 if ( lastContour.empty () ) {
374373 lastContour.moveTo ( pos );
375374 }
375+ else if ( lastContour.isClosed () ) {
376+ // Can't add to closed contour - start a new one
377+ getActiveShape ().moveTo ( pos );
378+ }
376379 else {
377380 lastContour.lineTo ( pos );
378381 }
You can’t perform that action at this time.
0 commit comments