Refactored to use AffineTransform rather than my hack job.