Fixed calma custom paths (pathtype 4) so that it doesn't generate

an error message (otherwise it was already being handled correctly).
This commit is contained in:
Tim Edwards 2017-10-06 16:42:41 -04:00
parent 8258058aab
commit e099dde8d2
2 changed files with 13 additions and 2 deletions

View File

@ -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)
{

View File

@ -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