https://issues.apache.org/bugzilla/show_bug.cgi?id=45012

           Summary: updateRenderingTransform() optimization causes
                    translation offset errors
           Product: Batik
           Version: 1.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bridge
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


In AbstractJSVGComponent.updateRenderingTransform() there is this code:

     if (at.equals(vt)) {
         // No new transform
         // Only repaint if size really changed.
         return ((oldD.width != d.width) || (oldD.height != d.height));
     }

The code that follows this code handles adjusting the center point in the case
that this.recenterOnResize=true.

I believe this code is wrong to return without executing the subsequent code,
because even though the size may not have changed, the center point may have
changed. The correct optimization would be to test whether either the size OR
the center point have changed.

For an example, consider a square image with "xMidYMid meet" which is centered
in a tall, narrow window, so that there is whitespace above and below. Now
resize the window in height only. The result is that the image does not change
size at all, but it should move up or down as the window is resized taller or
shorter. This does not happen because of the above code.

As a result, an "offset" error gets added into the rendering transform. These
errors are cumulative and tend to get worse over time. By manipulating the
window size the right way, it's even possible to eventually cause the image to
entirely shift out of the viewing window.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to