summaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-01-25 15:44:09 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-01-25 15:44:09 +0000
commit0160678109ddc1f4887b2c06df73a6de827c9bd2 (patch)
treeb4efaf33887d1959e29983dd21037d908d861029 /src/math
parentc5b1b0f5d7b7ef32d1930a217e569699d2551374 (diff)
downloadzetacomponents-graph-0160678109ddc1f4887b2c06df73a6de827c9bd2.zip
zetacomponents-graph-0160678109ddc1f4887b2c06df73a6de827c9bd2.tar.gz
- Always return $this, to enable "fluent interfaces"
Diffstat (limited to 'src/math')
-rw-r--r--src/math/vector.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/math/vector.php b/src/math/vector.php
index bef549c..efe44b3 100644
--- a/src/math/vector.php
+++ b/src/math/vector.php
@@ -26,6 +26,8 @@ class ezcGraphVector extends ezcGraphCoordinate
$tmp = $this->x;
$this->x = -$this->y;
$this->y = $tmp;
+
+ return $this;
}
/**
@@ -38,6 +40,8 @@ class ezcGraphVector extends ezcGraphCoordinate
$tmp = $this->x;
$this->x = $this->y;
$this->y = -$tmp;
+
+ return $this;
}
/**
@@ -55,6 +59,8 @@ class ezcGraphVector extends ezcGraphCoordinate
$this->x /= $length;
$this->y /= $length;
+
+ return $this;
}
/**
@@ -80,6 +86,8 @@ class ezcGraphVector extends ezcGraphCoordinate
{
$this->x *= $value;
$this->y *= $value;
+
+ return $this;
}
/**
@@ -103,6 +111,8 @@ class ezcGraphVector extends ezcGraphCoordinate
{
$this->x += $vector->x;
$this->y += $vector->y;
+
+ return $this;
}
/**
@@ -115,6 +125,8 @@ class ezcGraphVector extends ezcGraphCoordinate
{
$this->x -= $vector->x;
$this->y -= $vector->y;
+
+ return $this;
}
/**
OpenPOWER on IntegriCloud