summaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-09-06 09:34:53 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-09-06 09:34:53 +0000
commitb7b8d6da07309da4e16397f662a4e2db46c0869a (patch)
treea76a982bef0844f6d3d0eeb7089a7e8a5dfb2ee0 /src/math
parent4e50ab6291dc2430ef9ce4cc42c100c021e1a3b0 (diff)
downloadzetacomponents-graph-b7b8d6da07309da4e16397f662a4e2db46c0869a.zip
zetacomponents-graph-b7b8d6da07309da4e16397f662a4e2db46c0869a.tar.gz
- Enhanced font configuration
- Use Free Type 2 by default now, fallback to native ttf, if not available - Use t1lib for PostScript Type1 fonts - Throw an exception, if some texts could not be rendered with minimum font size
Diffstat (limited to 'src/math')
-rw-r--r--src/math/boundings.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/math/boundings.php b/src/math/boundings.php
new file mode 100644
index 0000000..78ce6cb
--- /dev/null
+++ b/src/math/boundings.php
@@ -0,0 +1,56 @@
+<?php
+
+class ezcGraphBoundings
+{
+ public $x0 = 0;
+
+ public $y0 = 0;
+
+ public $x1 = false;
+
+ public $y1 = false;
+
+ /**
+ * Empty constructor
+ */
+ public function __construct( $x0 = 0, $y0 = 0, $x1 = false, $y1 = false )
+ {
+ $this->x0 = $x0;
+ $this->y0 = $y0;
+ $this->x1 = $x1;
+ $this->y1 = $y1;
+
+ // Switch values to ensure correct order
+ if ( $this->x0 > $this->x1 )
+ {
+ $tmp = $this->x0;
+ $this->x0 = $this->x1;
+ $this->x1 = $tmp;
+ }
+
+ if ( $this->y0 > $this->y1 )
+ {
+ $tmp = $this->y0;
+ $this->y0 = $this->y1;
+ $this->y1 = $tmp;
+ }
+ }
+
+ /**
+ * Throws a BasePropertyNotFound exception.
+ */
+ public function __get( $name )
+ {
+ switch ( $name )
+ {
+ case 'width':
+ return $this->x1 - $this->x0;
+ case 'height':
+ return $this->y1 - $this->y0;
+ default:
+ throw new ezcBasePropertyNotFoundException( $name );
+ }
+ }
+}
+
+?>
OpenPOWER on IntegriCloud