Skip to content
Browse files

Allow polygon points to be specified as any combination of string / a…

…rray points.
  • Loading branch information...
1 parent 184b6f5 commit eb8fe4de7ac58b1bb326927c6480c1e1cb0e0ee3 @xdissent committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 raphael.shapes.js
View
4 raphael.shapes.js
@@ -90,12 +90,12 @@ Raphael.el.star = function() {
// polygon function
Raphael.el.polygon = function() {
var poly_array = ["M"],
- points = this.setts.points.split(" "),
+ points = typeof this.setts.points == "string" ? this.setts.points.split(" ") : this.setts.points,
n = points.length,
i = 0;
while (n--) {
- var point = points[i].split(","),
+ var point = typeof points[i] == "string" ? points[i].split(",") : points[i],
p;
if (!isNaN(p = parseFloat(point[0]))) {

0 comments on commit eb8fe4d

Please sign in to comment.
Something went wrong with that request. Please try again.