From 5d055d9fd20a2f4e5078bd722513ce905e9a6146 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 27 Mar 2012 11:33:28 -0700 Subject: Check for webGLWorld before calling draw. Signed-off-by: Nivesh Rajbhandari --- js/tools/EyedropperTool.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index 7458a9e8..d627f03b 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js @@ -395,9 +395,12 @@ exports.EyedropperTool = Montage.create(toolBase, { this._webGlWorld.importJSON(worldData); this._webGlWorld.render(); setTimeout(function() { - this._webGlWorld.draw(); - this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); - return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); + if(this._webGlWorld) + { + this._webGlWorld.draw(); + this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); + return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); + } }.bind(this), 250); } } -- cgit v1.2.3 From 6d03f6716104bf5b5daf9c8399623797e1672c89 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 27 Mar 2012 11:47:43 -0700 Subject: Reverting change for IKNinja-1355 because it is causing line tool to fail. Signed-off-by: Nivesh Rajbhandari --- js/controllers/color-controller.js | 4 ++-- js/controllers/elements/shapes-controller.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/controllers/color-controller.js b/js/controllers/color-controller.js index 8e000b19..c6d664cf 100755 --- a/js/controllers/color-controller.js +++ b/js/controllers/color-controller.js @@ -227,14 +227,14 @@ exports.ColorController = Montage.create(Component, { // this.fill = color; // - if(e._event.wasSetByCode && mode !== 'nocolor') return; + if(e._event.wasSetByCode) return; // this.setColor(mode, color, true); } else if (input === 'stroke') { // this.stroke = color; // - if(e._event.wasSetByCode && mode !== 'nocolor') return; + if(e._event.wasSetByCode) return; this.setColor(mode, color, false); } diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 5b9e4672..f0e9458b 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -274,6 +274,10 @@ exports.ShapesController = Montage.create(CanvasController, { color = this.getShapeProperty(el, "stroke"); } + if(!css) { + return null; + } + css = this.application.ninja.colorController.colorModel.webGlToCss(color); return this.application.ninja.colorController.getColorObjFromCss(css); } -- cgit v1.2.3