Hi Till,
I think both your problems are caused by your SVG documents lacking both width/height & viewBox attributes. If you provided either of these your problems would go away. Without either of these we are free to select an arbitrary Width/Height so we use the window W/H - this then causes a clip (since you don't have overflow="visible"). In the second case the windows starts out as 1x1 so your content is clipped to a single pixel.
I think you will be a lot happier if you provide basic info like width/height and viewBox in your SVG documents.
till varoquaux wrote:
I have two problems that seem linked:
-When I load an SVGDocument in a JSVGComponent if the image size is larger than the JSVGComponent's size it gets clipped to the display size (when I resize it afterward)...
-If I load a document when I load a Jframe (or before the frame is loaded) I get only a blank document....
Any workarounds???
Till
public class RootWindow extends JFrame{ /** * */ JSVGCanvas svgCanvas=new JSVGCanvas(); public RootWindow() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); svgCanvas.setURI(this.getClass().getResource("prairie.svg").toString()); //getContentPane().add(new Terrain_View(),BorderLayout.CENTER); getContentPane().add(svgCanvas); setSize(400,400); }
}
--------------------------------------------------------------------- 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]
