diff --git a/VERSION b/VERSION index 7de7407f..99fbe27b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.546 +8.3.547 diff --git a/commands/CmdRS.c b/commands/CmdRS.c index 5393e10a..796b1e56 100644 --- a/commands/CmdRS.c +++ b/commands/CmdRS.c @@ -1121,14 +1121,36 @@ CmdSelect( /*-------------------------------------------------------------------- * Move the selection relative to the cell def + * With two additional arguments: Arguments are X and Y position + * With no additional arugments: X and Y position taken from pointer. *-------------------------------------------------------------------- */ case SEL_MOVE: - if ((more) || (less) || (primargs != 4)) goto usageError; + if ((more) || (less) || ((primargs != 4) && (primargs != 2))) + goto usageError; - p.p_x = cmdParseCoord(w, cmd->tx_argv[2], FALSE, TRUE); - p.p_y = cmdParseCoord(w, cmd->tx_argv[3], FALSE, FALSE); + if (primargs == 2) + { + MagWindow *window; + Rect rootBox; + + window = ToolGetPoint(&p, (Rect *)NULL); + if ((window == NULL) || + !ToolGetBox(&SelectRootDef, &rootBox) || + (EditRootDef != ((CellUse *) window->w_surfaceID)->cu_def)) + { + TxError("Error: Pointer is not in the edit cell.\n"); + return; + } + p.p_x -= rootBox.r_xbot; + p.p_y -= rootBox.r_ybot; + } + else + { + p.p_x = cmdParseCoord(w, cmd->tx_argv[2], FALSE, TRUE); + p.p_y = cmdParseCoord(w, cmd->tx_argv[3], FALSE, FALSE); + } /* Erase first, then recompute the transform */ GeoTransRect(&SelectUse->cu_transform, &SelectDef->cd_bbox, &selarea); diff --git a/doc/html/select.html b/doc/html/select.html index a333a7d8..976a2813 100644 --- a/doc/html/select.html +++ b/doc/html/select.html @@ -99,9 +99,12 @@ create a new cell definition from a selection.
Copy the selection from the layout into the selection buffer, and keep the selection buffer for interactive processing. -
move x y +
move [ x y ]
Move the selection buffer to position x y, - relative to the cell definition origin. + relative to the cell definition origin. If x and + y are not given, the move the selection buffer so + that its lower left corner is at the current pointer + position.
bbox
Return the bounding box of the selection.
feedback [ style [ text ]]