diff options
author | Nivesh Rajbhandari | 2012-03-27 15:43:51 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-27 15:43:51 -0700 |
commit | b5d16f318e23a98d2b75afb902a7d0da6d18a10d (patch) | |
tree | c071597f11ae399fe98661c1ca6a3b86d080db4d /js | |
parent | b1eb3f5cc37f6e58e765f24221c3f0445a3ee75a (diff) | |
parent | 675fffb08f570783f055471501f94fc273de2b9e (diff) | |
download | ninja-b5d16f318e23a98d2b75afb902a7d0da6d18a10d.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLMaterials
Diffstat (limited to 'js')
-rwxr-xr-x | js/controllers/color-controller.js | 4 | ||||
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 4 | ||||
-rwxr-xr-x | js/tools/EyedropperTool.js | 9 |
3 files changed, 12 insertions, 5 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, { | |||
227 | // | 227 | // |
228 | this.fill = color; | 228 | this.fill = color; |
229 | // | 229 | // |
230 | if(e._event.wasSetByCode && mode !== 'nocolor') return; | 230 | if(e._event.wasSetByCode) return; |
231 | // | 231 | // |
232 | this.setColor(mode, color, true); | 232 | this.setColor(mode, color, true); |
233 | } else if (input === 'stroke') { | 233 | } else if (input === 'stroke') { |
234 | // | 234 | // |
235 | this.stroke = color; | 235 | this.stroke = color; |
236 | // | 236 | // |
237 | if(e._event.wasSetByCode && mode !== 'nocolor') return; | 237 | if(e._event.wasSetByCode) return; |
238 | 238 | ||
239 | this.setColor(mode, color, false); | 239 | this.setColor(mode, color, false); |
240 | } | 240 | } |
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 3f8f27d3..f18801fd 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -274,6 +274,10 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
274 | color = this.getShapeProperty(el, "stroke"); | 274 | color = this.getShapeProperty(el, "stroke"); |
275 | } | 275 | } |
276 | 276 | ||
277 | if(!css) { | ||
278 | return null; | ||
279 | } | ||
280 | |||
277 | css = this.application.ninja.colorController.colorModel.webGlToCss(color); | 281 | css = this.application.ninja.colorController.colorModel.webGlToCss(color); |
278 | return this.application.ninja.colorController.getColorObjFromCss(css); | 282 | return this.application.ninja.colorController.getColorObjFromCss(css); |
279 | } | 283 | } |
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, { | |||
395 | this._webGlWorld.importJSON(worldData); | 395 | this._webGlWorld.importJSON(worldData); |
396 | this._webGlWorld.render(); | 396 | this._webGlWorld.render(); |
397 | setTimeout(function() { | 397 | setTimeout(function() { |
398 | this._webGlWorld.draw(); | 398 | if(this._webGlWorld) |
399 | this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); | 399 | { |
400 | return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); | 400 | this._webGlWorld.draw(); |
401 | this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); | ||
402 | return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); | ||
403 | } | ||
401 | }.bind(this), 250); | 404 | }.bind(this), 250); |
402 | } | 405 | } |
403 | } | 406 | } |