Add transform to calculateBounds, fix transform