Fixed issue with custom shape affine transform. References #2525