Changed fillMatrix(x, y)

The previous fillMatrix was pretty convoluted. This one is actually faster, and much more readable (IMO).
Although it does have if (ternary) statements, it is faster because it calculates each x or y coordinate only once.
I found that this new function made the whole scaling algorithm take about 60% the time as the previous (Firefox 33.1).