Calc bounding box for shapes and transform