fixed white gaps/misaligned blocks that occur at certain screen dimensions at startup

This commit is contained in:
lengstrom 2014-06-22 16:49:26 -04:00
parent 6c105fd460
commit 3ac66a1c55
2 changed files with 6 additions and 2 deletions

View file

@ -41,8 +41,6 @@ function pause(x,o,message) {
}
}
keypress.register_combo({
keys: "left",
on_keydown: function() {

View file

@ -163,7 +163,13 @@ function init() {
MainClock = saveState.clock || new Clock(settings.hexWidth);
scaleCanvas();
settings.blockHeight = settings.baseBlockHeight * settings.scale;
settings.hexWidth = settings.baseHexWidth * settings.scale;
MainClock.sideLength = settings.hexWidth;
for(var i=0; i<MainClock.blocks.length; i++) {
MainClock.blocks[i].height = settings.blockHeight;
for(var j=0; j<MainClock.blocks[i].length; j++) {
var block = MainClock.blocks[i][j];
block.distFromHex = 2 * MainClock.sideLength / Math.sqrt(3) + (j-1) * block.height;