@@ -802,7 +802,6 @@ UPDATE_AND_RENDER(UpdateAndRender)
802
802
803
803
if (!Memory -> IsInitialized )
804
804
{
805
- /* Reset(State); */
806
805
InitArena (& Arena , (u8 * )Memory -> PermanentStorage + sizeof (state ), Memory -> PermanentStorageSize - sizeof (state ));
807
806
808
807
// NOTE: need initial save state to undo to
@@ -1272,7 +1271,7 @@ UPDATE_AND_RENDER(UpdateAndRender)
1272
1271
Assert (State -> ipoSelect );
1273
1272
poAtDist = ChooseCirclePoint (State , CanvasMouseP , SnapMouseP , C_ShapeLock .EndedDown );
1274
1273
1275
- if (DEBUGClick (C_Arc ))
1274
+ if (DEBUGClick (C_FullShape ))
1276
1275
{ // start drawing arc/circle
1277
1276
v2 poFocus = POINTS (State -> ipoSelect );
1278
1277
f32 Radius = State -> Length ;
@@ -1300,6 +1299,7 @@ UPDATE_AND_RENDER(UpdateAndRender)
1300
1299
1301
1300
case MODE_ExtendArc :
1302
1301
{
1302
+ Assert (State -> ipoSelect );
1303
1303
Assert (State -> ipoArcStart );
1304
1304
poAtDist = ChooseCirclePoint (State , CanvasMouseP , SnapMouseP , C_ShapeLock .EndedDown );
1305
1305
@@ -1308,8 +1308,9 @@ UPDATE_AND_RENDER(UpdateAndRender)
1308
1308
if (!C_Arc .EndedDown )
1309
1309
{ // finish drawing arc/circle
1310
1310
v2 poFocus = POINTS (State -> ipoSelect );
1311
+ v2 poExtend = ClosestPtOnCircle (SnapMouseP , poFocus , State -> Length );
1311
1312
if (V2WithinEpsilon (SnapMouseP , poFocus , POINT_EPSILON ) ||
1312
- V2WithinEpsilon (SnapMouseP , POINTS (State -> ipoArcStart ), POINT_EPSILON ))
1313
+ V2WithinEpsilon (poExtend , POINTS (State -> ipoArcStart ), POINT_EPSILON ))
1313
1314
{ // Same angle -> full circle
1314
1315
AddCircle (State , State -> ipoSelect , State -> ipoArcStart );
1315
1316
}
0 commit comments