fixes odd-number scale factor snap offset
This commit is contained in:
parent
2553f297d1
commit
da593e93ed
1 changed files with 6 additions and 1 deletions
|
@ -275,7 +275,12 @@ function sleep(ms) {
|
||||||
|
|
||||||
function snap(i) {
|
function snap(i) {
|
||||||
// very cheap test proof of concept but it works surprisingly well
|
// very cheap test proof of concept but it works surprisingly well
|
||||||
var snapOffset = i % basePixelCount;
|
var scaleOffset = 0;
|
||||||
|
if (scaleFactor % 2 != 0) {
|
||||||
|
// odd number, snaps to center of cell, oops
|
||||||
|
scaleOffset = 32;
|
||||||
|
}
|
||||||
|
var snapOffset = i % basePixelCount - scaleOffset;
|
||||||
if (snapOffset == 0) {
|
if (snapOffset == 0) {
|
||||||
return snapOffset;
|
return snapOffset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue