aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
authorPushkar Joshi2012-02-07 15:22:11 -0800
committerPushkar Joshi2012-02-07 15:22:11 -0800
commit9b6b228524f14bf65ba60aaf3d0993c8ec5bff2d (patch)
tree37bb26044958e8e991d08e271a1f67337a2029d4 /js/helper-classes
parent4bbe42e6d01fd0f81d13357a75b40eae9925dda3 (diff)
downloadninja-9b6b228524f14bf65ba60aaf3d0993c8ec5bff2d.tar.gz
some minor bug fixes and code cleanup
Diffstat (limited to 'js/helper-classes')
-rw-r--r--js/helper-classes/RDGE/GLSubpath.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/js/helper-classes/RDGE/GLSubpath.js b/js/helper-classes/RDGE/GLSubpath.js
index 74134a7e..383194d4 100644
--- a/js/helper-classes/RDGE/GLSubpath.js
+++ b/js/helper-classes/RDGE/GLSubpath.js
@@ -146,6 +146,8 @@ function GLSubpath() {
146 ctx.lineCap = lineCap[1]; 146 ctx.lineCap = lineCap[1];
147 ctx.beginPath(); 147 ctx.beginPath();
148 148
149 /*
150 commenting this out for now because of Chrome bug where coincident endpoints of bezier curve cause the curve to not be rendered
149 var prevAnchor = this.getAnchor(0); 151 var prevAnchor = this.getAnchor(0);
150 ctx.moveTo(prevAnchor.getPosX()-bboxMin[0],prevAnchor.getPosY()-bboxMin[1]); 152 ctx.moveTo(prevAnchor.getPosX()-bboxMin[0],prevAnchor.getPosY()-bboxMin[1]);
151 for (var i = 1; i < numAnchors; i++) { 153 for (var i = 1; i < numAnchors; i++) {
@@ -157,18 +159,19 @@ function GLSubpath() {
157 var currAnchor = this.getAnchor(0); 159 var currAnchor = this.getAnchor(0);
158 ctx.bezierCurveTo(prevAnchor.getNextX()-bboxMin[0],prevAnchor.getNextY()-bboxMin[1], currAnchor.getPrevX()-bboxMin[0], currAnchor.getPrevY()-bboxMin[1], currAnchor.getPosX()-bboxMin[0], currAnchor.getPosY()-bboxMin[1]); 160 ctx.bezierCurveTo(prevAnchor.getNextX()-bboxMin[0],prevAnchor.getNextY()-bboxMin[1], currAnchor.getPrevX()-bboxMin[0], currAnchor.getPrevY()-bboxMin[1], currAnchor.getPosX()-bboxMin[0], currAnchor.getPosY()-bboxMin[1]);
159 prevAnchor = currAnchor; 161 prevAnchor = currAnchor;
160 }
161 if (this._isClosed){
162 ctx.fill(); 162 ctx.fill();
163 } 163 }
164 */
164 165
165 /*
166 var numPoints = this._samples.length/3; 166 var numPoints = this._samples.length/3;
167 ctx.moveTo(this._samples[0],this._samples[1]); 167 ctx.moveTo(this._samples[0]-bboxMin[0],this._samples[1]-bboxMin[1]);
168 for (var i=0;i<numPoints;i++){ 168 for (var i=0;i<numPoints;i++){
169 ctx.lineTo(this._samples[3*i]-bboxMin[0],this._samples[3*i + 1]-bboxMin[1]); 169 ctx.lineTo(this._samples[3*i]-bboxMin[0],this._samples[3*i + 1]-bboxMin[1]);
170 } 170 }
171 */ 171 if (this._isClosed === true) {
172 ctx.lineTo(this._samples[0]-bboxMin[0],this._samples[1]-bboxMin[1]);
173 ctx.fill();
174 }
172 ctx.stroke(); 175 ctx.stroke();
173 ctx.restore(); 176 ctx.restore();
174 } //render() 177 } //render()
@@ -224,10 +227,8 @@ GLSubpath.prototype.removeAnchor = function (index) {
224 retAnchor = this._Anchors.splice(index, 1); 227 retAnchor = this._Anchors.splice(index, 1);
225 this._dirty = true; 228 this._dirty = true;
226 } 229 }
227 //deselect the removed anchor if necessary 230 //deselect the removed anchor
228 if (this._selectedAnchorIndex === index){ 231 this._selectedAnchorIndex = -1;
229 this._selectedAnchorIndex = -1;
230 }
231 return retAnchor; 232 return retAnchor;
232} 233}
233 234