Просмотр исходного кода

round all drawn pixl coordinates by default.

you can disable this, but this won't preserve the imprecise pixls upon
redraw. (because we store the pixls in a very crude way.)
Lucas Stadler лет назад: 12
Родитель
Сommit
6e6a135ae1
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      js/pixl/public/index.html

+ 1 - 0
js/pixl/public/index.html

@ -90,6 +90,7 @@
90 90
		pixl.draw_pixl = function(pos, color, options) {
91 91
			var color = color || pixl.color;
92 92
			pixl.ctx.fillStyle = color;
93
			var pos = options.rawValue ? pos : {x: Math.round(pos.x), y: Math.round(pos.y)};
93 94
			var screen_pos = pixl.to_screen(pos);
94 95
			pixl.ctx.fillRect(screen_pos.x, screen_pos.y, pixl.size, pixl.size);
95 96
			pixl.world[pos.x + "," + pos.y] = {color: color};