From f01736183a71b7d07a560584b85901b3f78df965 Mon Sep 17 00:00:00 2001 From: kangax Date: Sat, 1 Sep 2012 23:22:01 -0400 Subject: [PATCH] Fix straight-line polyline/polygon rendering. --- src/polygon.class.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/polygon.class.js b/src/polygon.class.js index 8b0c0233..f7256f7e 100644 --- a/src/polygon.class.js +++ b/src/polygon.class.js @@ -54,8 +54,9 @@ maxX = max(points, 'x'), maxY = max(points, 'y'); - this.width = maxX - minX; - this.height = maxY - minY; + this.width = (maxX - minX) || 1; + this.height = (maxY - minY) || 1; + this.minX = minX; this.minY = minY; },