Hi thomas,
  Thanks for ur opinion about 'viewbox'.  I decided to solve the problem in
another way and it seems I succeeded.
  I debugged batik's source code and found there existed a  'render rect'
used to clip . Initially the 'render rect' will be set the same as viewport
if no 'viewbox' attribute were set. When scroll bar is moved/dragged, the
scroll pane will call 'setRenderingTransform' to show other parts of svg
image, but since the 'render rect' is not changed and remained as the
original viewport position(0,0) , so new content won't be showed since it
will be clipped by the 'rendering rect'.  Then I adjusted 'render rect' each
time scroll bar is moved , it works .
  'Render rect' including 'bounds' of document's root node, 'bounds' and
'clip' of canvas node.
  This way maybe somewhat of 'hacker' since people have to fall into batik
implementation deeply. Any other normal solutions?




2010/5/25 <thomas.dewe...@kodak.com>

> Hi Colin,
>
> zhan hai <hai.zhan...@gmail.com> wrote on 05/23/2010 02:03:57 AM:
>
>
> >   If new elements are added to position out of the initial bbox, the
> > canvas won't show these elements. So I want to change viewbox again
> > to make viewbox contains the newly added element and i expect scroll
> > pane can resize it's scroll bar to map the extended viewbox.
>
>
>         Well the simplest thing is to set 'overflow="visible"' on
> the root SVG element.
>
> > But after calling 'setAttributeNS
> > (null,SVGConstants.SVG_VIEW_BOX_ATTRIBUTE,'xxxx'), all things in
> > canvas disappeard .
> > Any suggestions?
>
>         I've tested this before and it has worked.  Are you sure your
> 'xxxx' is a valid viewBox specification?  I should also say that
> setting the viewBox is a very expensive operation as we have to
> rebuild the entire graphics tree because any attributes that use
> percentages are likely to have changed.
>

Reply via email to