Modified the "flatten" command so that ports of the topmost cell
are preserved, which seems like reasonable behavior.
This commit is contained in:
parent
f3febfae73
commit
2cc557532d
|
|
@ -1865,6 +1865,7 @@ flatCopyAllLabels(scx, lab, tpath, targetUse)
|
||||||
{
|
{
|
||||||
Rect labTargetRect;
|
Rect labTargetRect;
|
||||||
int targetPos;
|
int targetPos;
|
||||||
|
int flags = 0;
|
||||||
CellDef *def;
|
CellDef *def;
|
||||||
char labelname[1024];
|
char labelname[1024];
|
||||||
char *n, *f, c;
|
char *n, *f, c;
|
||||||
|
|
@ -1894,6 +1895,8 @@ flatCopyAllLabels(scx, lab, tpath, targetUse)
|
||||||
* not a port; possibly we should retain ports taken from the
|
* not a port; possibly we should retain ports taken from the
|
||||||
* top level cell, but certainly not any others.
|
* top level cell, but certainly not any others.
|
||||||
*/
|
*/
|
||||||
|
if (tpath && (*tpath->tp_first) == '\0')
|
||||||
|
flags = lab->lab_flags;
|
||||||
|
|
||||||
/* To-do Feb. 2008: Translate target rotation and offset */
|
/* To-do Feb. 2008: Translate target rotation and offset */
|
||||||
|
|
||||||
|
|
@ -1903,7 +1906,7 @@ flatCopyAllLabels(scx, lab, tpath, targetUse)
|
||||||
strcpy(n, lab->lab_text);
|
strcpy(n, lab->lab_text);
|
||||||
DBPutFontLabel(def, &labTargetRect, lab->lab_font, lab->lab_size,
|
DBPutFontLabel(def, &labTargetRect, lab->lab_font, lab->lab_size,
|
||||||
lab->lab_rotate, &lab->lab_offset, targetPos,
|
lab->lab_rotate, &lab->lab_offset, targetPos,
|
||||||
f, lab->lab_type, 0);
|
f, lab->lab_type, flags);
|
||||||
*n = c;
|
*n = c;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -1932,7 +1935,7 @@ CmdFlatten(w, cmd)
|
||||||
TxCommand *cmd;
|
TxCommand *cmd;
|
||||||
{
|
{
|
||||||
int rval, xMask;
|
int rval, xMask;
|
||||||
bool dolabels, dobox, toplabels, invert;
|
bool dolabels, dobox, toplabels, invert, doports;
|
||||||
char *destname;
|
char *destname;
|
||||||
CellDef *newdef;
|
CellDef *newdef;
|
||||||
CellUse *newuse;
|
CellUse *newuse;
|
||||||
|
|
@ -1944,6 +1947,7 @@ CmdFlatten(w, cmd)
|
||||||
dolabels = TRUE;
|
dolabels = TRUE;
|
||||||
toplabels = FALSE;
|
toplabels = FALSE;
|
||||||
dobox = FALSE;
|
dobox = FALSE;
|
||||||
|
doports = TRUE;
|
||||||
|
|
||||||
rval = 0;
|
rval = 0;
|
||||||
if (cmd->tx_argc > 2)
|
if (cmd->tx_argc > 2)
|
||||||
|
|
@ -1978,6 +1982,9 @@ CmdFlatten(w, cmd)
|
||||||
case 't':
|
case 't':
|
||||||
toplabels = (invert) ? FALSE : TRUE;
|
toplabels = (invert) ? FALSE : TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
doports = (invert) ? FALSE : TRUE;
|
||||||
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
xMask = (invert) ? CU_DESCEND_NO_SUBCKT : CU_DESCEND_ALL;
|
xMask = (invert) ? CU_DESCEND_NO_SUBCKT : CU_DESCEND_ALL;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1985,7 +1992,7 @@ CmdFlatten(w, cmd)
|
||||||
xMask = (invert) ? CU_DESCEND_NO_VENDOR : CU_DESCEND_ALL;
|
xMask = (invert) ? CU_DESCEND_NO_VENDOR : CU_DESCEND_ALL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
TxError("options are: -nolabels, -nosubcircuits "
|
TxError("options are: -nolabels, -nosubcircuits, -noports, "
|
||||||
"-novendor, -dotoplabels, -dobox\n");
|
"-novendor, -dotoplabels, -dobox\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue