summaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-31 16:16:05 +0100
committerwout <wout@impinc.co.uk>2012-12-31 16:16:05 +0100
commit5e7c26e9423f3c543e04bc9a11656125ec7bf8ca (patch)
tree5e568b9a8083aa23b1bf830b7f4a42a3c8c1a1c0 /src/element.js
parent8dbe3599dd9b80738c4124f7e71bc12e763c50dc (diff)
downloadsvg.js-5e7c26e9423f3c543e04bc9a11656125ec7bf8ca.tar.gz
svg.js-5e7c26e9423f3c543e04bc9a11656125ec7bf8ca.zip
Added each(), next(), previous() and more
Diffstat (limited to 'src/element.js')
-rw-r--r--src/element.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/element.js b/src/element.js
index a9cd7cd..5db42b3 100644
--- a/src/element.js
+++ b/src/element.js
@@ -182,6 +182,16 @@ SVG.extend(SVG.Element, {
};
},
+ // is a given point inside the bounding box of the element
+ inside: function(x, y) {
+ var b = this.bbox();
+
+ return x > b.x &&
+ y > b.y &&
+ x < b.x + b.width &&
+ y < b.y + b.height;
+ },
+
// show element
show: function() {
this.node.style.display = '';