diff --git a/src/PhpPresentation/Traits/ShapeCollection.php b/src/PhpPresentation/Traits/ShapeCollection.php index 6c7582cb1..0a2d1c5c3 100644 --- a/src/PhpPresentation/Traits/ShapeCollection.php +++ b/src/PhpPresentation/Traits/ShapeCollection.php @@ -81,6 +81,10 @@ public function addShape(AbstractShape $shape) { $this->shapeCollection[] = $shape; + if (method_exists($shape, 'setContainer') && $shape->getContainer() === null) { + $shape->setContainer($this); + } + return $this; }