Round at draw stage

This commit is contained in:
zenoamaro committed 2019-06-30 02:04:58 +02:00
1 parent 926e41096b
commit 4ba6851165
4 files changed
+28 -17

No files matched your search

+6 -1
View File
@@ -1,8 +1,13 @@
export function index2coords(width, i) {
return [i % width, Math.floor(i/width)];
i = Math.round(i);
width = Math.round(width);
return [i % width, i / width];
}
export function coords2index(width, x, y) {
x = Math.round(x);
y = Math.round(y);
width = Math.round(width);
return y * width + x;
}