loktar00/Javascript-Canvas-Terrain-Generator

Fix pixels on the left in the rendering code

Closed this issue · 3 comments

To fix this, change on index.js and line 206 the following:

    for(x = 0; x <= size; x += unitSize){
        for(y = 0; y <= size; y += unitSize){

to:

for(x = 0; x < size - 1; x += unitSize){
    for(y = 0; y < size - 1; y += unitSize){

Mind doing a PR? I mean I can just add this as well, but this is something I was meaning to fix forever and never got to it, lol granted it's not a huge amount of code, but you should get the credit regardless :P.

If you don't want to do a PR it's cool I can just commit it in.

Done!

Thanks for the great algorithm @loktar00

Regards,

Weird I never closed this, thanks for fixing the code!