aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib')
-rwxr-xr-xjs/lib/geom/sub-path.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/js/lib/geom/sub-path.js b/js/lib/geom/sub-path.js
index 7e11bb33..2ecafa1c 100755
--- a/js/lib/geom/sub-path.js
+++ b/js/lib/geom/sub-path.js
@@ -95,6 +95,11 @@ var GLSubpath = function GLSubpath() {
95 } 95 }
96 this.createSamples(false); //dirty bit checked in this function...will generate a polyline representation 96 this.createSamples(false); //dirty bit checked in this function...will generate a polyline representation
97 97
98 var numPoints = this._Samples.length;
99 if (numPoints === 0){
100 return; //nothing to do for empty paths
101 }
102
98 //figure the size of the area we will draw into 103 //figure the size of the area we will draw into
99 var bboxWidth=0, bboxHeight=0; 104 var bboxWidth=0, bboxHeight=0;
100 bboxWidth = this._BBoxMax[0] - this._BBoxMin[0]; 105 bboxWidth = this._BBoxMax[0] - this._BBoxMin[0];
@@ -142,7 +147,6 @@ var GLSubpath = function GLSubpath() {
142 147
143 148
144 ctx.beginPath(); 149 ctx.beginPath();
145 var numPoints = this._Samples.length;
146 ctx.moveTo(this._Samples[0][0],this._Samples[0][1]); 150 ctx.moveTo(this._Samples[0][0],this._Samples[0][1]);
147 for (var i=0;i<numPoints;i++){ 151 for (var i=0;i<numPoints;i++){
148 ctx.lineTo(this._Samples[i][0],this._Samples[i][1]); 152 ctx.lineTo(this._Samples[i][0],this._Samples[i][1]);