code: @SuppressWarnings("deprecation")
     private void updateParentBoundingBox(SvgElement obj)
     {
        if (obj.parent == null)       // skip this if obj is root element
           return;
        if (obj.boundingBox == null)  // empty bbox, possibly as a result of a badly defined element (eg bad use reference etc)
           return;
  
        // Convert the corners of the child bbox to world space
        Matrix  m = new Matrix();
        // Get the inverse of the child transform
        if (matrixStack.peek().invert(m)) {
           float[] pts = {obj.boundingBox.minX, obj.boundingBox.minY,
                          obj.boundingBox.maxX(), obj.boundingBox.minY,
                          obj.boundingBox.maxX(), obj.boundingBox.maxY(),
                          obj.boundingBox.minX, obj.boundingBox.maxY()};
           // Now concatenate the parent's matrix to create a child-to-parent transform
           m.preConcat(canvas.getMatrix());
           m.mapPoints(pts);
           // Finally, find the bounding box of the transformed points
           RectF  rect = new RectF(pts[0], pts[1], pts[0], pts[1]);
           for (int i=2; i<=6; i+=2) {
              if (pts[i] < rect.left) rect.left = pts[i]; 
              if (pts[i] > rect.right) rect.right = pts[i]; 
              if (pts[i+1] < rect.top) rect.top = pts[i+1]; 
              if (pts[i+1] > rect.bottom) rect.bottom = pts[i+1]; 
           }
           // Update the parent bounding box with the transformed bbox
           SvgElement  parent = (SvgElement) parentStack.peek();
           if (parent.boundingBox == null)
              parent.boundingBox = Box.fromLimits(rect.left, rect.top, rect.right, rect.bottom);
           else
              parent.boundingBox.union(Box.fromLimits(rect.left, rect.top, rect.right, rect.bottom));
        }
     }
docs: /*
  Called by an object to update it's parent's bounding box.
  
  This operation is made more tricky because the childs bbox is in the child's coordinate space,
  but the parent needs it in the parent's coordinate space.