I have got a problem in case of using the method getBBox. For Example my SVG
Document have got two circle elements. Now i am trying to get the element
from the canvas on click. The problem here is, that i only can click on the
lastChild of my circle element. Also the program is now assigning all circle
elements.
the part of the program:
if (n instanceof SVGCircleElement) {
SVGCircleElement svgElement = (SVGCircleElement) n;
if (e.getPoint().x >= svgElement.getBBox().getX()
&& e.getPoint().x <=
(svgElement.getBBox().getX() + svgElement
.getBBox().getWidth())
&& e.getPoint().y >=
svgElement.getBBox().getY()
&& e.getPoint().y <=
(svgElement.getBBox().getY() + svgElement
.getBBox().getHeight())) {
System.out.println("circle");
svgElement.setAttribute("fill", "red");
} else {
svgElement.removeAttribute("fill");
}
--
View this message in context:
http://old.nabble.com/getBBox-problem-with-SVGElements-tp29181765p29181765.html
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]