I wrote:
> Hi,
> 
> I'm working with Batik 1.6 on x86_64 linux with Blackdown 1.4.2-02
> (64bit). I'm displaying a dynamic document in a JSVGCanvas, and am
> trying to keep it top-left aligned, and still have it scale when I
> resize the frame the canvas is in.
> For this I set preserveAspectRatio="xMinYMin meet" on my document's
> outermost svg. Initially, the canvas' preferred size matches the
> width/height ratio of the document.
> If I resize the window grabbing it by the bottom-right angle,
> everything's fine. Now if I do so from just the right side or the bottom
> side, it seems fine at first (scaling on reduction, and no change on
> extension, as expected), but after an extension, subsequent reducing
> resizes will cause parts of the document to get lost past the top or
> left side. It looks like something in the coordinate system got
> corrupted in the process. Reinitialising the view with CTL+SHIFT+Right
> click doesn't solve the issue.
> If this is really a Batik bug and not me missing something, I suspect
> the problem lies in JSVGComponent.updateRenderingTransform(), but
> nothing I could spot on quick inspection given my limited understanding
> of how this works.
> 
> Regards,
> Thomas
> 

Do I misunderstand the standard or implementation, or is this really a
bug ?

My understanding of preserveAspectRatio="xMinYMin meet" is that the
document should always stay top-left anchored, and scale linearly.
This is not what's happening in batik at the moment. 

I get this for example, resizing by grabbing the window from the right
side :

Canvas resized: width height
AffineTransform: TranslateX TranslateY

Canvas resized: 420 604
AffineTransform: 0.0 0.0

Canvas resized: 421 604
AffineTransform: 0.0 -1.0

Canvas resized: 422 604
AffineTransform: 0.0 -2.0

Canvas resized: 488 604
AffineTransform: 30.0 -6.0

Canvas resized: 567 604
AffineTransform: 30.0 -6.0

Canvas resized: 598 604
AffineTransform: 30.0 -6.0

Canvas resized: 287 604
AffineTransform: -37.0 95.0

At the end some content is lost past the left border of the canvas, and
the document is no more top-anchored, despite "xMinYMin".

When the document is set to "xMidYMid", getTranslateX() and
getTranslateY() from the rendering transform always return 0.

With xMin, getTranslateX() starts to return weird values.
With YMin, it's getTranslateY()'s turn.

It looks like a rounding error to me.

For now I work around the problem by registering a ComponentListener on
the canvas, then getting the rendering transform in the componentResized
callback and calling setToTranslation(0, 0) on it.

I'd appreciate some feedback on this. 

Thanks,
Thomas



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to