diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-05 19:24:29 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-05 19:24:29 +0200 |
commit | 81184b836a6ddbeaca5f85781a052cb36424e37f (patch) | |
tree | 1965bd34b4e351e5148a1412e618555b72330117 /app/bin/compound.c | |
parent | 67d0ce65dc6a1d240e271a7cd479b60aa1dc2967 (diff) | |
parent | c1f7a0251136f6327d14a85eb5a761489551b668 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'app/bin/compound.c')
-rw-r--r-- | app/bin/compound.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/bin/compound.c b/app/bin/compound.c index 972ff82..dad7dda 100644 --- a/app/bin/compound.c +++ b/app/bin/compound.c @@ -522,7 +522,7 @@ static descData_t compoundDesc[] = { /*SC*/ { DESC_LONG, N_("# Segments"), &compoundData.segCnt }, /*LY*/ { DESC_LAYER, N_("Layer"), &compoundData.layerNumber }, { DESC_NULL } }; - +#define MAX_DESCRIBE_ENDS 4 static void UpdateCompound( track_p trk, int inx, descData_p descUpd, BOOL_T needUndoStart ) @@ -682,7 +682,7 @@ static void UpdateCompound( track_p trk, int inx, descData_p descUpd, BOOL_T nee case E3: case AN: case OR: - for (int i=0;i<compoundData.epCnt;i++) { + for (int i=0;(i<compoundData.epCnt)&&(i<MAX_DESCRIBE_ENDS);i++) { compoundData.endPt[i] = GetTrkEndPos(trk,i); compoundDesc[i*(E1-E0)+E0].mode |= DESC_CHANGE; trackParams_t params; @@ -803,7 +803,7 @@ void DescribeCompound( compoundDesc[SC].mode = DESC_RO; compoundDesc[LY].mode = DESC_NOREDRAW; if (compoundData.epCnt >0) { - for (int i=0;i<compoundData.epCnt;i++) { + for (int i=0;(i<compoundData.epCnt)&&(i<MAX_DESCRIBE_ENDS);i++) { compoundDesc[A0+(E1-E0)*i].mode = (int)mode; compoundDesc[R0+(E1-E0)*i].mode = DESC_RO; compoundDesc[C0+(E1-E0)*i].mode = DESC_RO; @@ -952,6 +952,7 @@ EXPORT track_p NewCompound( xx->segCnt = segCnt; xx->segs = memdup( segs, segCnt * sizeof *segs ); trkSeg_p p = xx->segs; + CopyPoly(xx->segs, xx->segCnt); FixUpBezierSegs(xx->segs,xx->segCnt); ComputeCompoundBoundingBox( trk ); SetDescriptionOrig( trk ); |