OK, yeah, that sounds complicated.  To draw those circles, I have to
know about all these points.  And it is different based on the element
type.  Let's just stick with the basic bounding box.

I have a double problem.  Remember how I'm using translations to move
elements around the canvas?  Translate information isn't stored in a
bounding box, so when I draw a bounding box, I have to apply translation
information.  Not terribly hard (I don't think).  The second problem is
screen coordinates.  I have to face the issue of drawing a bounding box
of a translated element on a zoomed canvas.  This is like the opposite
of drawing on a zoomed canvas.  I have to tell the glass pane how to
draw properly based on the state of the canvas, not render to the canvas
based on the glass pane.

What's the best approach of drawing a translated element to a zoomed
in/out canvas?  Which should be applied first?  I'm just trying to find
a starting point for going down this trail.

Michael Bishop

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 28, 2005 2:19 PM
To: [email protected]
Subject: RE: Element -> Bounding Box?

Hi Michael,

"Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on

11/28/2005 02:12:25 PM:

> OK, here's a slightly more complicated question.  Is there a way to
make
> "points" on an element respond to a mouse event?

   No, you could create new geometry (say small circles) that sit on top
of the rect element's geometry.

>  Say I draw some kind of polygon.  Then I "select" it, so I know which

> element it belongs to. Now I'd like to grab one of the points in the 
> polygon and "move" that point, altering its shape. 

  Adding the circles could be part of the 'highlighting'.

> For example, taking a rectangle and dragging two of its points 
> to form a trapezoid. Is this possible with existing tools?

   Well this brings up another point which is that once you drag one
of the point's it is no longer a rect so you will need to be able
to generalize geometry 'on the fly'.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 28, 2005 1:24 PM
> To: [email protected]
> Subject: Re: Element -> Bounding Box?
> 
> Hi Michael,
> 
>     Check out SVGLocatable.getBBox(). 
> 
> "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote
on
> 
> 11/28/2005 11:16:24 AM:
> 
> > Is there a way to do this?  Citing the old drag and drop approach, I
> can 
> 
> > select an Element by clicking on it.  Now I'd like to "outline" that

> Element 
> > to show it's been selected.  I see it can be done with other
objects, 
> but is 
> > there a way to get from Element to bounding box?
> 
>    All of the SVG graphical elements (g, svg, rect, path, ellipse,
text,
> 
> use, etc) implement this interface.
> Of course not every 'Element' implements this interface as even in SVG

> many do not have a 
> reasonable BBox (think gradient), and of course it's even harder to 
> imagine what one would return for
> elements in other namespaces.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to