xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tonny Kohar <to...@kiyut.com>
Subject Re: "Drag" selection box...how to?
Date Tue, 07 Feb 2006 01:22:16 GMT
Hi,

On Fri, 2006-02-03 at 12:41 -0500, Bishop, Michael W. CONTR J9C880
wrote:
>      I’ve worked with listeners to drag and drop elements around a
> JSVGCanvas.  This method works primarily by registering which elements
> receive the mouse up/down events.  What I want to do is implement a
> selection “box” where you drag a box around a number of elements and
> it will select all the elements that fall within that box.  I need
> some way to translate screen coordinates to document coordinates which
> is a known problem.  What I don’t know how to do is ask the document
> “Which elements fall inside this box?”

We have similar problem for our Sketsa SVG Graphics Editor.
We solve the problem by
1) Traverse or Iterate the DOM tree
2) compare each element bbox with the selection box

The draw back of this methods, is that the bigger the dom tree, the
longer it will take to traverse/iterate the whole DOM tree

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message