https://bugs.kde.org/show_bug.cgi?id=381732
Buggy solution for all parts of the bug, provided more for reference than usage.
A proper solution should handle a layer with tiles that are moved off the left or top of a layer and not have any funky behavior when a transform mask is used.