Editing Line Graphic [was: no subject]

Martin Baxter martin at materiaprima.fsnet.co.uk
Fri Apr 9 12:29:25 EDT 2004


Hello Beat and welcome,

I'm not exactly clear what you are doing, but there are some oddities in
editing a line graphic with the mouse and I think you have run into them.
The way I would script changes to a line graphic is to set its "points"
property by script (without selecting it). This property consists of 2
lines with a point in each like so:

x,y
x,y

to change it you can do:

<<
put the points of graphic 1 into tmp
add 1 to item 2 of line 1 of tmp -- 1 pixel down e.g.
set the points of graphic 1 to tmp
>>

with this method can manipulate it any way you want.

Instead of "selecting" the graphic (I'm just guessing that's what you are
doing) in order to edit it, I would suggest  a better way is to make a
button which is a fake "drag handle" (one for each end of the line) and put
a drag script inside it that sets the points property of the line to the
loc of the drag handle. Ask again if you would like more on how this is
done.

Martin

>Hello everyone,
>
>I'm new to Rev (coming from Hypercard) and I'm delighted with the
>many new possibilities of Rev.
>
>My question : I made a script to move and change direction of a line
>(a graphic). Works well until I want the former top to be beneath the
>former bottom. E.g. My line runs from bottom left to top right. Now I
>grab the top right side and drag it down. All goes well until the the
>top comes within 2 pixels from the bottom coordinate. I can't manage
>to go lower than the bottom, even if I exchange the bottom and top
>coordinates. What happens is that the line is horizontal now and
>moves down as a whole. The left side does not stay in its former
>location in de y direction but moves along (downwards) with the new
>bottom coordinate. It must be possible to do, as in the edit mode it
>is no problem to drag the top of the line in my example to a place
>below the former bottom.
>
>Thanks a lot for any answers,
>Greetings , Beat
>--




More information about the use-livecode mailing list