Fixed the "flatten" command so that "-dotoplabels" works as advertised,

and doesn't crash magic.
This commit is contained in:
Tim Edwards 2023-03-25 15:06:25 -04:00
parent fc62a63d41
commit 7b9809e567
1 changed files with 5 additions and 4 deletions

View File

@ -2123,15 +2123,16 @@ CmdFlatten(w, cmd)
DBCellCopyAllPaint(&scx, &DBAllButSpaceAndDRCBits, xMask, flatDestUse);
DBFlatCopyMaskHints(&scx, xMask, flatDestUse);
if (dolabels)
FlatCopyAllLabels(&scx, &DBAllTypeBits, xMask, flatDestUse);
else if (toplabels)
if (toplabels)
{
int savemask = scx.scx_use->cu_expandMask;
scx.scx_use->cu_expandMask = CU_DESCEND_SPECIAL;
DBCellCopyAllLabels(&scx, &DBAllTypeBits, CU_DESCEND_SPECIAL, flatDestUse);
DBCellCopyAllLabels(&scx, &DBAllTypeBits, CU_DESCEND_SPECIAL, flatDestUse,
NULL);
scx.scx_use->cu_expandMask = savemask;
}
else if (dolabels)
FlatCopyAllLabels(&scx, &DBAllTypeBits, xMask, flatDestUse);
if (xMask != CU_DESCEND_ALL)
DBCellCopyAllCells(&scx, xMask, flatDestUse, (Rect *)NULL);