summaryrefslogtreecommitdiffstats
path: root/src/poly.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/poly.js')
-rwxr-xr-x[-rw-r--r--]src/poly.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/poly.js b/src/poly.js
index 937960d..93a40fd 100644..100755
--- a/src/poly.js
+++ b/src/poly.js
@@ -32,6 +32,18 @@ SVG.extend(SVG.Polyline, SVG.Polygon, {
, y: function(y) {
return y == null ? this.bbox().y : this.move(this.bbox().x, y)
}
+ // Set width of element
+, width: function(width) {
+ var b = this.bbox()
+
+ return width == null ? b.width : this.size(width, b.height)
+ }
+ // Set height of element
+, height: function(height) {
+ var b = this.bbox()
+
+ return height == null ? b.height : this.size(b.width, height)
+ }
// Set element size to given width and height
, size: function(width, height) {
return this.attr('points', this.points.size(width, height))