From e099dde8d2dedaf869c166902f2801a98df63a20 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 6 Oct 2017 16:42:41 -0400 Subject: [PATCH] Fixed calma custom paths (pathtype 4) so that it doesn't generate an error message (otherwise it was already being handled correctly). --- calma/CalmaRdpt.c | 14 ++++++++++++-- calma/calmaInt.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/calma/CalmaRdpt.c b/calma/CalmaRdpt.c index 1e61d4bf..c018dc41 100644 --- a/calma/CalmaRdpt.c +++ b/calma/CalmaRdpt.c @@ -443,7 +443,8 @@ calmaElementPath() if (nbytes > 0 && rtype == CALMA_PATHTYPE) if (!calmaReadI2Record(CALMA_PATHTYPE, &pathtype)) return; - if (pathtype != CALMAPATH_SQUAREFLUSH && pathtype != CALMAPATH_SQUAREPLUS) + if (pathtype != CALMAPATH_SQUAREFLUSH && pathtype != CALMAPATH_SQUAREPLUS && + pathtype != CALMAPATH_CUSTOM) { calmaReadError("Warning: pathtype %d unsupported (ignored).\n", pathtype); pathtype = CALMAPATH_SQUAREFLUSH; @@ -469,8 +470,17 @@ calmaElementPath() width /= calmaReadScale2; + /* Set path extensions based on path type */ + if (pathtype == CALMAPATH_SQUAREFLUSH || pathtype == CALMAPATH_CUSTOM) + { + extend1 = extend2 = 0; + } + else if (pathtype == CALMAPATH_SQUAREPLUS || pathtype == CALMAPATH_ROUND) + { + extend1 = extend2 = (width / 2); + } + /* Handle BGNEXTN, ENDEXTN */ - extend1 = extend2 = 0; PEEKRH(nbytes, rtype); if (nbytes > 0 && rtype == CALMA_BGNEXTN) { diff --git a/calma/calmaInt.h b/calma/calmaInt.h index 49b3d94c..978da3a6 100644 --- a/calma/calmaInt.h +++ b/calma/calmaInt.h @@ -110,6 +110,7 @@ #define CALMAPATH_SQUAREFLUSH 0 /* Square end flush with endpoint */ #define CALMAPATH_ROUND 1 /* Round end */ #define CALMAPATH_SQUAREPLUS 2 /* Square end plus half-width extent */ +#define CALMAPATH_CUSTOM 4 /* Endcaps at specified lengths */ /* Largest calma layer or data type numbers */ #define CALMA_LAYER_MAX 255