keyboard-layout-editor icon indicating copy to clipboard operation
keyboard-layout-editor copied to clipboard

Snap-to-grid feature to prevent and/or fix rounding issues

Open bergstar opened this issue 8 years ago • 2 comments

When setting stepsize to 0,125 system wound round it all up, so after a few moves, it gets extra +0.01 So its imposible to return key moved with 0,125 steps to its original position.

So one move to the left, and back - will give 14,01 after original 14

bergstar avatar Jun 17 '16 12:06 bergstar

I have similar issues, it pops up worse when using angled keys. I think if you modify some settings in the JavaScript (there's a min step size or somesuch) you will have better control. When I initially added code for setting the step size I let it go down to 0.01 but IJP changed it to 0.05 for some reason, guess he thought that was small enough.

iandoug avatar Jul 09 '16 18:07 iandoug

Floating-point math is hard. There's probably no way to guarantee numbers don't 'drift' occasionally.

I think what we really need is a snap-to-grid feature, which would allow you to quickly snap keys back to a defined grid. I'll rename this issue accordingly.

ijprest avatar Sep 16 '18 22:09 ijprest