Added a command option for "select move" without specifying the
X and Y values, in which case the selection is moved to the current pointer position. This allows a different implementation of the "copy" command as "select move; select keep", which avoids the problem that "copy" has of modifying the selection with layer interactions with the existing layout.
This commit is contained in:
parent
e9f2628f41
commit
b1095b323c
|
|
@ -1121,14 +1121,36 @@ CmdSelect(
|
||||||
|
|
||||||
/*--------------------------------------------------------------------
|
/*--------------------------------------------------------------------
|
||||||
* Move the selection relative to the cell def
|
* 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:
|
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);
|
if (primargs == 2)
|
||||||
p.p_y = cmdParseCoord(w, cmd->tx_argv[3], FALSE, FALSE);
|
{
|
||||||
|
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 */
|
/* Erase first, then recompute the transform */
|
||||||
GeoTransRect(&SelectUse->cu_transform, &SelectDef->cd_bbox, &selarea);
|
GeoTransRect(&SelectUse->cu_transform, &SelectDef->cd_bbox, &selarea);
|
||||||
|
|
|
||||||
|
|
@ -99,9 +99,12 @@ create a new cell definition from a selection.
|
||||||
<DD> Copy the selection from the layout into the selection
|
<DD> Copy the selection from the layout into the selection
|
||||||
buffer, and keep the selection buffer for interactive
|
buffer, and keep the selection buffer for interactive
|
||||||
processing.
|
processing.
|
||||||
<DT> <B>move</B> <I>x y</I>
|
<DT> <B>move</B> [ <I>x y</I> ]
|
||||||
<DD> Move the selection buffer to position <I>x y</I>,
|
<DD> Move the selection buffer to position <I>x y</I>,
|
||||||
relative to the cell definition origin.
|
relative to the cell definition origin. If <I>x</I> and
|
||||||
|
<I>y</I> are not given, the move the selection buffer so
|
||||||
|
that its lower left corner is at the current pointer
|
||||||
|
position.
|
||||||
<DT> <B>bbox</B>
|
<DT> <B>bbox</B>
|
||||||
<DD> Return the bounding box of the selection.
|
<DD> Return the bounding box of the selection.
|
||||||
<DT> <B>feedback</B> [ <I>style</I> [ <I>text</I> ]]
|
<DT> <B>feedback</B> [ <I>style</I> [ <I>text</I> ]]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue