protected function prepareRenderParams(SVGRasterizer $rasterizer, array $options)
 {
     $scaleX = $rasterizer->getScaleX();
     $scaleY = $rasterizer->getScaleY();
     $points = array();
     foreach ($options['points'] as $point) {
         $points[] = $point[0] * $scaleX;
         $points[] = $point[1] * $scaleY;
     }
     return array('open' => isset($options['open']) ? $options['open'] : false, 'points' => $points, 'numpoints' => count($options['points']));
 }
Beispiel #2
0
 /**
  * Parses the length string in relation to the rasterizer's X dimension.
  *
  * @param string        $len The CSS length string.
  * @param SVGRasterizer $ras The rasterizer for scaling the length.
  *
  * @return float The parsed and scaled length, in pixels.
  */
 protected static function prepareLengthX($len, SVGRasterizer $ras)
 {
     $doc = $ras->getDocumentWidth();
     $scale = $ras->getScaleX();
     return SVG::convertUnit($len, $doc) * $scale;
 }