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

[ISSUE 271] Move/Size step min size and default stepping size change.

Open ellisgl opened this issue 6 years ago • 7 comments

ellisgl avatar Feb 13 '20 21:02 ellisgl

https://github.com/ijprest/keyboard-layout-editor/issues/271

ellisgl avatar Feb 13 '20 21:02 ellisgl

It probably doesn't need to be 0.0001. It can probably be 0.0005 without loss of functionality, because useful steps are usually repeatedly divisions by 2:

0.5 0.25 0.125 0.0625 ← possible with 0.0005 resolution (or even 0.0025) 0.03125 ←not possible with 0.0001 resolution

Btw, does changing the parameters of just the spinner boxes also prevent rounding the coordinates down the line? Is this tested?

MarkJeronimus avatar Feb 14 '20 09:02 MarkJeronimus

I looked for reference to those two inputs and couldn't find anything about rounding. I'll double check that. I can change it to 0.0005 - I was just selecting something as the at highest res available for 4 decimal places.

0.03125 would not be possible with 0.0005 either.

ellisgl avatar Feb 16 '20 03:02 ellisgl

@MarkJeronimus I tested and just fixed a couple rounding issues. Floating point addition in JS is silly.

ellisgl avatar Mar 05 '20 03:03 ellisgl

Best way is to adopt the strategy used by monetary calculations. Use integer fixed-point precision (i.e. cents or hundreds of cents) and only convert to floating point when presenting values to the user.

I just realized the most common steps also includes the binary divisions of 0.75". Thats: 0.75 0.375 0.1875 0.09375 0.046875

You could use integer units which are 1/64th of an inch (0.015625") which would accommodate all those and the divisions of 0.5".

MarkJeronimus avatar Mar 05 '20 10:03 MarkJeronimus

I was using 19.05 mm as 1 U. So in my setup in KiCAD, I use a 1.190625 mm grid, which is 1/16th (0.0625) of 1 U based on 19.05. But from what I can tell, this is all based on U, not in or mm, so you could go down to 0.0005 U, if you wanted to.

ellisgl avatar Mar 06 '20 14:03 ellisgl

FWIW, back in the day I set move step to 0.1, but IJP pushed it back to 0.5. Same with sizes and rotate.

iandoug avatar Jun 10 '21 18:06 iandoug