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'])); }
/** * Parses the length string in relation to the rasterizer's Y 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 prepareLengthY($len, SVGRasterizer $ras) { $doc = $ras->getDocumentWidth(); $scale = $ras->getScaleY(); return SVG::convertUnit($len, $doc) * $scale; }