Example #1
0
 /**
  * Sets the transform data, both local and cumulative, for the element
  * @param DOMElement $node
  */
 public function setTransform(DOMElement $node)
 {
     $transformation = $node->hasAttribute(IdmlAttributes::ItemTransform) ? $node->getAttribute(IdmlAttributes::ItemTransform) : '';
     $this->transformation = new IdmlTransformation($transformation);
     // If the parent element contains a transformation, accumulate the tx and ty values
     if (is_a($this->parentElement, 'IdmlElement') && isset($this->parentElement->transformation)) {
         // get the parent's cumulative transform values
         $cumTx = $this->transformation->xTranslate() + $this->parentElement->transformation->xTranslate();
         $cumTy = $this->transformation->yTranslate() + $this->parentElement->transformation->yTranslate();
         $this->transformation->setXY($cumTx, $cumTy);
     }
 }