Comment 2 for bug 1262146

Revision history for this message
Alvin Penner (apenner) wrote : Re: persistent offset when scaling an object with "Scale stroke width" unchecked and "Optimized Transforms"

The attached file, collapse.svg, shows what happens after trying to return it back to its original state by dragging the bottom edge up to compress the shape back to a square. The vertical offset remains. If subsequent stretches and collapses are performed then the offset just accumulates and gets worse, never better. While doing these stretches it is important that the mouse must release the object, it is the release and regrabbing that appears to trigger the offset.

Similarly, horizontal stretching by the same edge will lead to horizontal offset. But stretching at an angle of 45 degrees will lead to zero offset. The offset is related to the degree of asymmetry between horizontal motion and vertical motion.

The calculations for doing the scaling are done in the routine get_scale_transform_for_uniform_stroke() in sp-item-transform.cpp. However it appears that the error is occurring upstream, in the parameters that are being fed to this routine. The routine contains info on the last known position at the end of the previous stretch and also the first known position at the beginning of the current stretch. These two should of course be the same, but they are not always the same, which leads to the offset.