summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Vector.h')
-rw-r--r--libs/hwui/Vector.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/Vector.h b/libs/hwui/Vector.h
index 5110272..15b9d6b 100644
--- a/libs/hwui/Vector.h
+++ b/libs/hwui/Vector.h
@@ -36,6 +36,10 @@ struct Vector2 {
x(px), y(py) {
}
+ float lengthSquared() const {
+ return x * x + y * y;
+ }
+
float length() const {
return sqrt(x * x + y * y);
}