summaryrefslogtreecommitdiffstats
path: root/library/vendor/dompdf/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--library/vendor/dompdf/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/library/vendor/dompdf/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php b/library/vendor/dompdf/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php
new file mode 100644
index 0000000..e504ffe
--- /dev/null
+++ b/library/vendor/dompdf/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * @package php-svg-lib
+ * @link http://github.com/PhenX/php-svg-lib
+ * @author Fabien Ménager <fabien.menager@gmail.com>
+ * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html
+ */
+
+namespace Svg\Tag;
+
+use Svg\Style;
+
+class Circle extends Shape
+{
+ protected $cx = 0;
+ protected $cy = 0;
+ protected $r;
+
+ public function start($attributes)
+ {
+ if (isset($attributes['cx'])) {
+ $width = $this->document->getWidth();
+ $this->cx = $this->convertSize($attributes['cx'], $width);
+ }
+ if (isset($attributes['cy'])) {
+ $height = $this->document->getHeight();
+ $this->cy = $this->convertSize($attributes['cy'], $height);
+ }
+ if (isset($attributes['r'])) {
+ $diagonal = $this->document->getDiagonal();
+ $this->r = $this->convertSize($attributes['r'], $diagonal);
+ }
+
+ $this->document->getSurface()->circle($this->cx, $this->cy, $this->r);
+ }
+}