jdan / isomer

Simple isometric graphics library for HTML5 canvas
http://jdan.github.io/isomer
MIT License
2.88k stars 138 forks source link

In the file js/isomer.js on line 112, you are using a global/window/self scope for color. It fails in "üse strict" mode #56

Closed LaughingSun closed 9 years ago

LaughingSun commented 9 years ago

In the file js/isomer.js on line 112, you are using a global/window/self scope for color. I pretty sure you meant local. Because of that it fails in strict mode, throwing that color is not defined.

Current code:

var brightness = Vector.dotProduct(normal, this.lightAngle); color = baseColor.lighten(brightness * this.colorDifference, this.lightColor);

Proposed fixes:

1) precede with 'var ', fe: var brightness = Vector.dotProduct(normal, this.lightAngle); var color = baseColor.lighten(brightness * this.colorDifference, this.lightColor);

OR

2) precede with comma, fe: var brightness = Vector.dotProduct(normal, this.lightAngle), color = baseColor.lighten(brightness * this.colorDifference, this.lightColor);

jdan commented 9 years ago

Yuck, good catch! Feel free to submit a PR, otherwise I'll fix soon :)

LaughingSun commented 9 years ago

yeah did a request, it is on line 109, not 112 on the current repo.

On Mon, Jan 12, 2015 at 10:06 AM, jdan notifications@github.com wrote:

Yuck, good catch! Feel free to submit a PR, otherwise I'll fix soon :)

— Reply to this email directly or view it on GitHub https://github.com/jdan/isomer/issues/56#issuecomment-69523395.

Erich Horn Denpasar, Bali, Indonesia (62) 82140467070