Skip to content

Commit

Permalink
One correction to the previous commit to restore the original
Browse files Browse the repository at this point in the history
behavior when a child coordinate is not specified;  otherwise,
the original code's setting of the child reference point to the
bounding box lower left causes the lower left point to be
used always, which is not how the getcell command is supposed to
function.
  • Loading branch information
RTimothyEdwards committed Jan 21, 2024
1 parent 7f55717 commit b08c785
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions commands/CmdCD.c
Original file line number Diff line number Diff line change
Expand Up @@ -4814,7 +4814,7 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
* cell itself.
*/
{
Point childPoint, editPoint, rootPoint, refpoint;
Point childPoint, editPoint, rootPoint;
CellDef *def, *rootDef, *editDef;
bool hasChild, hasRoot, hasTrans;
Rect rootBox, bbox;
Expand Down Expand Up @@ -5254,9 +5254,19 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
scx->scx_use = dummy;

/* Transform childPoint by trans_cell */
GeoTransPoint(&trans_cell, &childPoint, &refpoint);
GeoTranslateTrans(&trans_cell, rootPoint.p_x - refpoint.p_x,
if (hasChild)
{
Point refpoint;

GeoTransPoint(&trans_cell, &childPoint, &refpoint);
GeoTranslateTrans(&trans_cell, rootPoint.p_x - refpoint.p_x,
rootPoint.p_y - refpoint.p_y, &scx->scx_trans);
}
else
{
GeoTranslateTrans(&trans_cell, rootPoint.p_x - childPoint.p_x,
rootPoint.p_y - childPoint.p_y, &scx->scx_trans);
}

scx->scx_area = bbox;
return TRUE;
Expand Down

0 comments on commit b08c785

Please sign in to comment.