Hi, Chris-

| Can anyone supply me by giving me hints and tips in order to 
| accomplish
| resize of a group element, containing rects and text
| in SVG DOM ?

<g> elements do not have an implicit size. If you get the bounding box of a
group, you are really getting the bounding box of all its child elements. 

Probably, you are asking for script to resize a rectangle and
resize/reposition the text inside. The basic technique would be for you to
provide "handles" for the user to drag-and-drop (probably dots at the
corners, though handles on the sides would also work). In your mouseover
script, you monitor the delta (i.e. the change from the original position to
the current position), and you adjust the size of the rectangle accordingly.
To illustrate, if the person has grabbed the lower-right handle and dragged
it 5px up and 18px right, you get the current height attribute of the
rectangle, deduct 5 from it, and set the new value, and do the same to add
18 to the width. If they are dragging the left top handle, you will also
need to adjust the x and y attributes by the inverse of the delta, i.e. if
it were dragged up 13px and right 7px, you would add 13 to the height and
subtract 13 from the y, and subtract 7 from the width and add 7 to the x.

Depending on what you want to do with the text, you can then adjust its size
or position.

If you want to affect simply the size of both, you might alternately
consider altering the scale transform, but there are complications there
that might be daunting to a beginner. 

Regards-
Doug

[EMAIL PROTECTED]
www.vectoreal.com ...for scalable solutions.



-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to