xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: preserveAspectRatio problem
Date Wed, 10 May 2006 09:52:43 GMT
Hi Sudhakar,

Sudhakar S <yessudhakar@hotmail.com> wrote on 05/10/2006 03:02:58 AM:

> i have used preserveAspectRatio as none in my following example to avoid
> scaling. 

   PreserveAspectRation="none" simple allows for non-uniform scaling in
X and Y to make the viewBox fit the available viewport.

> But while resizing the canvas in squiggle, it is also resizing all
> the SVG elements inside the viewport. But  it is not supposed to resize 
the
> elements since preserveAspectRatio as none. So can anyone please provide 
how
> to stop resizing the elements while resizing the canvas?

   The simplest way is to not provide a viewBox, and potentially set
overflow="visible".  However I would lean towards breaking the Canvas's
implementation of the SVG specification so it doesn't always try
and map viewBox to viewport.  This can be done be replacing the
'updateRenderingTransform' method so it never changes the rendering
transform, and only returns true if the 'getSize()' is different
from prevComponentSize (see the code currently in 
JSVGComponent.updateRenderingTransfom()).

> <svg width="1500" height="1000" version="1.1"
> viewBox="0 0 1500 1000" preserveAspectRatio="none"


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


Mime
View raw message