Exemplo n.º 1
0
 /**
  * Return a string containing the SVG transform attribute values for the padding
  *
  * @param   RenderContext $ctx  The context to determine the translation coordinates
  *
  * @return  string              The transformation string
  */
 public function getInnerTransform(RenderContext $ctx)
 {
     list($translateX, $translateY) = $ctx->toAbsolute($this->padding[self::PADDING_LEFT] + $this->getX(), $this->padding[self::PADDING_TOP] + $this->getY());
     list($scaleX, $scaleY) = $ctx->paddingToScaleFactor($this->padding);
     $scaleX *= $this->getWidth() / 100;
     $scaleY *= $this->getHeight() / 100;
     return sprintf('translate(%s, %s) scale(%s, %s)', Format::formatSVGNumber($translateX), Format::formatSVGNumber($translateY), Format::formatSVGNumber($scaleX), Format::formatSVGNumber($scaleY));
 }