Maik Sch�rer wrote:

how can I get the coordinates/dimensions of the currently displayed piece of my SVG on SVGCanvas ?

In what coordinate system? In the screen coordinate system it's the components location and size - both easily obtainable from Swing ;) So I presume you mean somewhere inside your SVG document.

Example: my SVG is 2000x1000px and currently (because I zoomed in) a small piece of it is visible on SVGCanvas.
I want to know, what ist the coordinate of the upper left corner of this piece and its width and height...

You probably want to look at things like 'getScreenCTM' which will give you the transform to the screen coordinate system. Paired with 'getViewPort()' you will have the information needed to calculate this.

and a second question:
is it possible to detect, if the a SVG element (a text field e.g) is visible on the currently displayed piece of my SVG or if it is outside this area ?

You can use the intersection method or just do the simple check on the BBox of the text (you may need to use the getTransformToElement method to transform your BBOX to for example the root SVG element's user coordinate space).

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



Reply via email to