Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
The sizes are wrong. Size 3*3 should zoom to size 5*5, but your code produces 4*4, losing the bottom row and rightmost column.
The formula for the dimensions should be New = Old * 2 - 1; you have New = (Old - 1) * 2
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Other than that, good job, it really looks great.
Posts: 4,629
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
06-21-2016, 09:41 PM
(This post was last modified: 06-21-2016, 09:42 PM by NiLSPACE.)
I believe I fixed it. Could you try again?
EDIT:
Wait, something seems wrong now.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
The bounds in the for loops are too low, drop the "-1"
Posts: 4,629
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
I tried that, but now colors from the right can suddenly appear on the left as well.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Ah, that's because you're constructing the chain from the opposite side.
What the GrownGen actually does, it requests the lower data in an area larger by one in each dimension. In order to implement that in your visualiser, you'd need to modify the whole thing to not display the rightmost column and bottom row of the data, but still keep it for the future zoom / smooth operations.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.