The boundary box ought to be flush with the shape object. Currently, if you add a triangle (and make it big enough), you will see a gap between it and the bounding box. This gap, that scales with the size of the object, interferes with the programmatic sizing and placement of the shape as you cannot find the center. If I'm not being clear enough, I can provide an example with the case I'm currently running into.