kevinAlbs / minesweeper

https://minesweeper.kevinalbs.com/
2 stars 0 forks source link

Sprites rendered at incorrect offsets #1

Closed kevinAlbs closed 1 year ago

kevinAlbs commented 1 year ago

A user reported seeing this:

image

The createImageBitmap function is used to create sprites from a spritesheet:

ps.push(createImageBitmap(image, 17 * j, 49 + 17 * i, 16, 16));

I can reproduce this if I set offsets to 0 in all calls to createImageBitmap:

ps.push(createImageBitmap(image, 0, 0, 16, 16));
kevinAlbs commented 1 year ago

I am unsure if this is related to an incomplete implementation of createImageBitmap in a browser. Closing since https://github.com/kevinAlbs/minesweeper/commit/d83039373749a0dcbe9beac76cf08284ae664d6f removes use of createIImageBitmap.