Details
-
Bug
-
Status: Resolved
-
Resolution: Incomplete
-
1.7
-
None
-
None
-
Operating System: Linux
Platform: PC
Description
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.