Hello, I already posted this mail in batik-users but this one is probably a best place.
I'm using JSVGCanvas do display a Map. I've to dynamically draw points on this map. For my first test, I've overloaded the paint(Graphics g) method to do this job. The code for this is the following: public void paint ( Graphics g) { super.paint(g); AffineTransform at = new AffineTransform( getRenderingTransform()); if (at == null) return; SVGOMRectElement elem = (SVGOMRectElement)getSVGDocument().getElementById("water"); SVGMatrix matrix =elem.getCTM(); AffineTransform transform = new AffineTransform( matrix.getA(), matrix.getB(), matrix.getC(), matrix.getD(), matrix.getE(), matrix.getF()); transform.preConcatenate(at); g.setColor(Color.black); //((Graphics2D)g).setTransform( new AffineTransform()); paintPoint(g, 1, -5.0f, 63.0f, transform); paintPoint(g, 2, -5.0f, 57.5f, transform); paintPoint(g, 3, -5.0f, 52.0f, transform); paintPoint(g, 4, 12.0f, 52.0f, transform); paintPoint(g, 5, 12.0f, 57.5f, transform); paintPoint(g, 6, 12.0f, 63.0f, transform); /* // inscription des différentes position des structures for (int i=0; i<structsSize(); i++) { Structure f = structsAt(i); paintPoint( g, (i+1), f.getLon(), f.getLat(), transform); } */ } public void paintPoint ( Graphics g, int a_Index, float a_Lon, float a_Lat, AffineTransform a_Transform) { // inscription des différentes position des structures try { Point2D ini = new Point2D.Float(a_Lon, a_Lat); Point2D p2d = a_Transform.transform( ini, null); g.drawRect((int)p2d.getX() - 2, (int)p2d.getY() - 2, 4, 4); g.drawString(String.valueOf(a_Index), (int)p2d.getX()+9, (int)p2d.getY()+11); } catch (Exception e) { e.printStackTrace(); } } The result is quite strange! As you can see I try to draw the four corners of my map. The two upper corner are drawn correctly. But the to lower are not and seem to be place two times lower than they should. Am I right using the getRenderingTransform() method ? Does anyone have a idea of what happens ? Gerard -- [EMAIL PROTECTED] - Atlantide - http://www.ago.fr/atlantide/ Technopole Brest Iroise BP 80802 - 29608 Brest cedex - France - Tel. : +33 (0)2 98 05 43 21 - Fax. : +33 (0)2 98 05 20 34 - e-mail: [EMAIL PROTECTED] Centre Affaires Oberthur - 74D, rue de Paris - 35700 Rennes - France Tel. : +33 (0)2 99 84 15 84 - Fax : +33 (0)2 99 84 15 85 - e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]