Crash in UpdateBezier


Dave Bullis
 

A small crash in UpdateBezier() in this code where using Describe on a Bezier Line (not track(
This code assumes we have a Bezier track instead of a Line (which don't have EndPts)
    case CP1:
    if (GetTrkEndTrk(trk,0)) {
    angle1 = NormalizeAngle(GetTrkEndAngle(trk,0));

The track looks like
$2 = {base = {trkType = 5 '\005'}, pos = {{x = 53.625, y = 5.25}, {x = 65, y = 5}, {x = 62.375, y = 9}, {x = 72.125, 
      y = 6.25}}, minCurveRadius = 9.6541959882457284, a0 = 271.25904520717529, a1 = 105.75117366345302, 
  length = 18.825875418488778, arcSegs = {cnt = 4, max = 4, ptr = 0x5555563a9410}, descriptionOff = {x = 0, y = 0}, 
  segsWidth = 0, segsColor = 1, lineType = DRAWLINESOLID}

Is there something in here we could use for angle1?  .a0 perhaps?

CP2 has the same problem.

P0 and P1 also call GetTrkEndPt and Z0, Z1 assumes there are grades and endpt elevations.

Dave


Adam Richards
 

I’ll look later but basically the angle is the “end angle” between the control point and the end point in each case.

Adam


Adam Richards
 

Several bugs found and fixed surrounding Bezier Describe (track and line) 

1. Using endpoints for non-track

2. Not altering angles when end points or control points altered

3. Wrong type of angle results for altering track ctl points when end tracks

4. Not clearing old track when updating

5. Not making endpoint 1 R/O when end track at that end

6. Bonus - angles a0 and a1 were not set up properly on creation of track/line