Comment 8 for bug 953992

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

This bug might have been fixed as of rev. 12519. I'm not completely sure if this fix is ideal though, see the copy below of my post to the developers mailing list:

Hi devs,

I might just have fixed this blocker bug: https://bugs.launchpad.net/inkscape/+bug/953992; well at least the problem cannot be reproduced and I haven't noticed any new regressions, but I am not sure if this fix is correct. Let me try to explain:

When a pattern is imported, e.g. from Adobe Illustrator, then it might have a view box set. This is just fine, as this viewbox is accounted for by Inkscape. Now when an object that uses this pattern is moved, a new pattern is introduced to account for the translation. So we now have:
     object -> mother pattern (with transform) -> child pattern (as imported)

The child pattern has a view box set, but the current code only considered the viewbox of the newly introduced mother pattern... which didn't have a viewbox set. This is why the pattern wasn't drawn. I've modified the code to consider the viewbox of the child pattern instead. This works for the files attached to the bug report, and doesn't seem to break anything. However, isn't this all a bit too fragile? What if both the mother pattern and child pattern have a view box set? Is there a teeny-tiny wibbly-wobbly subset of documents in which this can actually occur? ;-).

BTW, our stock patterns do not have a viewbox, and neither do patterns generated from objects. This is why this bug was only visible for imported patterns. Also, this bug was introduced when moving to the new cairo rendered in which a significant part of pattern rendering code (in sp-pattern.cpp) was modified.

Thanks,

Diederik