Hi Michael, "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on 12/19/2006 10:24:32 AM:
> Yeah, that's what I was afraid of. I was hoping for some guidance > on doing it fairly simply, if there is such a way: > > - If the scroll bars of the JSVGScrollPane aren't visible, then just > size the JSVGCanvas according to the resize. Is this the default > behavior of the JSVGCanvas? Even inside a JSVGScrollPane? Hmm, actually when it's inside a scrollPane the scroll pane sets 'recenterOnResize' to false. Which means that the canvas keeps the upper left the upper left and just changes size ( showing more content on the right/bottom for example). > - If the scroll bars of the JSVGScrollPane are visible, then just size > the JSVGScrollPane's viewable area. > > Any hints on where to start? You might consider subclassing/replacing/modifying the JSVGScrollPane so it only sets recenterOnResize to false when the scrollbars are showing... > Would I even need to touch rendering transforms or would setting > the size on these components be sufficient? If you want the canvas to change scale or pan position then the rendering transform needs to change. The built in updateRenderingTransform function does this in some cases but I don't think you can all of what you want by adjusting component sizes. > I know it needs experimentation; I'm just trying to narrow down the > variables I need to play with. > > Michael Bishop > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday, December 15, 2006 6:53 AM > To: batik-users@xmlgraphics.apache.org > Cc: batik-users@xmlgraphics.apache.org > Subject: Re: Resizing a JSVGCanvas... > > > Hi Michael, > > "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on > 12/14/2006 09:12:44 AM: > > > so there are a bunch of transforms associated with the > > JSVGCanvas. Plus you define a viewBox attribute in your SVG > > document. What I'd like to do is have the JSVGCanvas resize when I > > resize my main Window/Frame. If the user has zoomed in or out, I > > want to preserve that. Basically I want to take what the user > > currently sees and resize it accordingly. > > I was under the impression that this was more or less the > default behavior of the Canvas. Anyway the code that handles > this is the 'updateRenderingTransform' method on the JSVGCanvas > (the default implementation is in AbstractJSVGComponent). > > > If the user's looking at an entire document and they resize the window > > > smaller, I want the entire document shown (smaller) in the smaller > > JSVGCanvas. If the user is zoomed in and has scrolled to an area of > > the document (I have a JSVGScrollPane), I want that viewing area to > > be the same when they resize. In short, I want to preserve what the > > user sees, just size it according to the window size. Can I get some > > pointers on how to achieve this? > > You can override the default implementation and do what ever you > want, however I warn you it's tricker than it seems... ;) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >