[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Re: Recipe needed: Elements outside the RenderingTransform context
From:       Helder_Magalhães <helder.magalhaes () gmail ! com>
Date:       2009-03-17 11:58:55
Message-ID: 2a1ddf8a0903170458m1e7eb986i8f09f45cd31c78b7 () mail ! gmail ! com
[Download RAW message or body]

Hi Alan Deikman,

> What I think is needed for many applications is a way in a JSVGCanvas to
> have controls that do not zoom, pan, and rotate with the rest of the
> picture.
[...]
> Any suggestions?

Something like the following (ECMAScript) might help:

  var iCTM = (document.documentElement.getScreenCTM()).inverse();
  var newMatrix = document.documentElement.createSVGTransformFromMatrix(iCTM);
  var targetElement = document.getElementById("YourElementID");
  targetElement.transform.baseVal.initialize(newMatrix);

It can be used in your "reset" button or similar, or simply attached
to UA events such as zoom, resize, etc. in order to create the
illusion of elements which do not resize. :-)

This should work in current SVG implementations (Batik, Firefox,
Opera, Webkit). I believe ASV and possibly other implementations
require additional trickery in order to work.

Also, it should be fairly easy to adapt this to Java environment. ;-)
Comments and other possible solutions are naturally welcome. :-)

Hope this helps,

  Helder Magalhães

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic