You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Dmitrij Sakara <dm...@epfl.ch> on 2004/10/14 16:19:46 UTC

Document resizing according to the canvas size.

Hi,

 

I would like to create a document that will cover at least all available
space on the canvas even when the canvas is resizing. Should I do this
with the canvas size listeners and consequent invocation of the
document.getDocumentElement().setAttributeNS() in order to change height
and width attributes or some other more elegant way exists.

 

Thank you.

Regards.
 
 

___________________________________________
 
Dmitrij SAKARA

STI IPR LICP
Swiss Federal Institute of Technology (EPFL)
Me - Ecublens
CH-1015 Lausanne
Switzerland
 
Tel. : +41 (0)21 / 693 5913
Fax. : +41 (0)21 / 693 3509

e-mail : dmitrij.sakara@epfl.ch

My office at EPFL: http://map.epfl.ch/?room=MEA1382
___________________________________________

 

Re: Document resizing according to the canvas size.

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

> I would like to create a document that will cover at least all
> available space on the canvas even when the canvas is resizing. Should
> I do this with the canvas size listeners and consequent invocation of
> the document.getDocumentElement().setAttributeNS() in order to change
> height and width attributes or some other more elegant way exists.

Try using width & height 100% and viewbox, then you do not need to do
programmatically. That's the beauty of SVG and Vector Graphics.

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



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


Re: Document resizing according to the canvas size.

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Dmitrij,

Dmitrij Sakara wrote:

> I would like to create a document that will cover at least all available 
> space on the canvas even when the canvas is resizing. Should I do this 
> with the canvas size listeners and consequent invocation of the 
> document.getDocumentElement().setAttributeNS() in order to change height 
> and width attributes or some other more elegant way exists.

    I think you can just set width/height to 100% and provide a viewBox
attribute and this will happen (you might also look at
preserveAspectRatio, which will allow you to control how the content
is fitted to the available w/h).

    BTW, you should now be able to use the getIntersectionList methods
to get the list of elements that intersect a rect (if you hadn't
already implemented yourself).


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