I would be interesting to "snapshot" your DOM after the unexpected flip occurs then:
- Save it to a file. - Verify relaunching squiggle on the file still shows item flipped. - Do analysis to determine whether matrix is incorrect (your bug) or batik is mis-reading it (batik bug). - If Batik is mis-reading matrix, create Bugzilla issue containing simplified counterexample SVG file. One possibility is your computation is broken around the "corner cases" of 90 and 270 degress. Continuous reading and updating of the matrix makes these corner cases more likely to be hit. On Jan 23, 2008 1:36 PM, Bishop, Michael W. CONTR J9C880 < [EMAIL PROTECTED]> wrote: > OK, the slider basically reports a degree from 0 to 359. I have a > ChangeListener attached that updates the "transform" attribute of the > selected element. > > So what essentially happens: > > - Retrieve the "transform" (I use the matrix only) attribute as an > AffineTransform. > - Revert the current rotation angle on the AffineTransform. > - Apply the new rotation angle to the AffineTransform. > - Convert the AffineTransform to a "transform" attribute. > - Apply the new "transform" attribute to the element on the > UpdateManager. > > I don't think static rotation covers it. My old rotation technique was > a plain JSlider that would only update the element after the change > occurs. This never fails. It only seems to happen when the document is > continuously updated as the slider is moving. Another interesting fact > is that sometimes an element STAYS flipped; when I get back to 0 > degrees, I see that a text element might be upside-down. > > If this behavior was consistant across all elements, I'd be more apt to > dig through my code. It only seems to happen with certain elements. > Maybe I can write a test case that will draw an element to a canvas, > then rotate it through 360 degrees with a for loop. > > Michael Bishop > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > On Behalf Of Archie Cobbs > > Sent: Wednesday, January 23, 2008 1:41 PM > > To: batik-users@xmlgraphics.apache.org > > Subject: Re: Rendering bug with transforms? > > > > What is your slider actually doing? > > > > If it's just updating the "transform" attribute of a DOM > > element, in theory you should be able to produce a static > > document containing a polygon rotated e.g. 120 degrees that > > squiggle renders upside down. > > > > I.e., what's the simplest document or program that reproduces > > incorrect rendering? I'm sure something obvious like an > > upside down rotation would be fixed pretty quickly. > > > > On the other hand, it could be your logic. How exactly does a > > circular slider position turn into SVG attributes? > > > > > > On Jan 23, 2008 12:31 PM, Bishop, Michael W. CONTR J9C880 > > <[EMAIL PROTECTED]> wrote: > > > > > > Hello, > > I've come across a pretty odd problem with Batik. > > I'm using the > > 1.7 release version. For my application, I've > > developed a "circle > > slider" which is pretty much a Jslider that goes in a > > circle. I use it > > to rotate elements from 0 degrees to 360 degrees. As I > > move the slider, > > the shape on the JSVGCanvas changes. This works > > perfectly for circle, > > ellipse, line, and rect elements. On other elements > > (polygon, polyline, > > path, text), the element is rapidly flipped 180 degrees > > ONLY when the > > circle slider is between 90 and 270 degrees. > > So I get a smooth rotation from 0 to 90. From 90 to 270 the > > element gets flipped upside-down over and over again, > > oscillating back > > and forth. From 270 to 360 (0), I get smooth rotation > > again. The > > reason I think it's Batik is because it doesn't occur > > with every element > > and my application is reporting the correct number of > > degrees. I think > > it's odd that it only happens witin that certain range. > > Has anyone > > experienced this? > > > > Michael Bishop > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > -- > > Archie L. Cobbs > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Archie L. Cobbs