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 Andreas Neumann <ne...@karto.baug.ethz.ch> on 2003/10/26 08:42:03 UTC
window properties, f.e. window.innerWidth
Hi!
I know that the "window" object is not part of the SVG spec, nevertheless it is
important to get cross-svgviewer compatibility.
I noticed that Batik has implemented all the methods of the window object, such
as setTimeout, alert, parseXML, etc. but currently no properties.
For my current project I need to get access to the innerWidth and innerHeight
property in order to properly display coordinates on mouse move.
Are there any plans to implement these missing properties?
Thanks for your info,
Andreas
--
The only thing that stands between a man and what he wants from
life is often merely the will to try it and the faith to believe
that it is possible ...
-- M. DeVos
----------------------------------------------
Andreas Neumann - Department of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg, CH-8093 Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.karto.ethz.ch/neumann/
SVG.Open/Carto.net: http://www.svgopen.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: window properties, f.e. window.innerWidth
Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
What I actually need are the coordinates within the viewPort - exactly the same
coordinates that you display in the Squiggle statusbar. I played around and
found out that getScreenCTM works fine in Batik.
The drawback is that it does not work in ASV3, but works in ASV6. Corel did not
implement it either. So I guess, what I will do is check whether the SVG viewer
has getScreenCTM implemented (Batik, ASV6) and for the other cases got with
innerWidth/Height (Corel, ASV3)
> Why do you need innerWidth/innerHeight. For most uses what you
> really want is the size of the viewport:
>
> SVGRect r = document.getRoot().getViewport(); // Java
>
> var r = document.root.viewport; // ECMAScript
>
> Which _is_ part of the SVG specification.
this only solves half of my problem. With .getViewport() I don't know the know
the offset of the viewPort within the window. When the window is small in X and
high in Y I have a offset in y, when it is wide in X and small in Y I have an
offset in x. .getViewport does not return this offset, but it seems like
.getScreenCTM works fine. So it seems that I don't need innerWidth for solving
my particular problem.
Andreas
--
The only thing that stands between a man and what he wants from
life is often merely the will to try it and the faith to believe
that it is possible ...
-- M. DeVos
----------------------------------------------
Andreas Neumann - Department of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg, CH-8093 Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.karto.ethz.ch/neumann/
SVG.Open/Carto.net: http://www.svgopen.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: window properties, f.e. window.innerWidth
Posted by Thomas DeWeese <Th...@Kodak.com>.
Andreas Neumann wrote:
> I know that the "window" object is not part of the SVG spec, nevertheless it is
> important to get cross-svgviewer compatibility.
>
> I noticed that Batik has implemented all the methods of the window object, such
> as setTimeout, alert, parseXML, etc. but currently no properties.
We have implemented a lot of them yes.
> For my current project I need to get access to the innerWidth and innerHeight
> property in order to properly display coordinates on mouse move.
Why do you need innerWidth/innerHeight. For most uses what you
really want is the size of the viewport:
SVGRect r = document.getRoot().getViewport(); // Java
var r = document.root.viewport; // ECMAScript
Which _is_ part of the SVG specification.
> Are there any plans to implement these missing properties?
In general we don't have a problem with implementing the ones that
are really needed (i.e. ones that really fill a hole), but generally
we won't implement them just because another viewer has.
> Thanks for your info,
> Andreas
>
> --
> The only thing that stands between a man and what he wants from
> life is often merely the will to try it and the faith to believe
> that it is possible ...
> -- M. DeVos
>
> ----------------------------------------------
> Andreas Neumann - Department of Cartography
> Swiss Federal Institute of Technology (ETH)
> ETH Hoenggerberg, CH-8093 Zurich, Switzerland
> Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
> e-mail: neumann@karto.baug.ethz.ch
> www: http://www.karto.ethz.ch/neumann/
> SVG.Open/Carto.net: http://www.svgopen.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org