Paint patterns relative to content base transformation.

Fixes #2943, #3458