OpenMacroBoard / OpenMacroBoard.SDK

MIT License
20 stars 10 forks source link

KeyPositionCollection.KeyDistanceX and KeyDistanceY are always 0 #18

Closed jskeet closed 2 years ago

jskeet commented 2 years ago

In the KeyPositionCollection constructor accepting dx and dy, I'd expect to see assignments:

KeyDistanceX = dx;
KeyDistanceY = dy;

... but they're not there, so the gap is always reported as 0 pixels.

wischi-chr commented 2 years ago

Sorry it took so long to respond. The change to version 4 took longer than expected.

I changed the key layout type a bit in v4.0.0-preview). Before it was (at least in theory) possible to create layouts that are not rectangular (to support keyboards for example) but that lead to a hand full of quirks were one had to use pattern matching just to get some basic details about a rectangular layout.

The current design should be way simpler for grid layouts like the stream deck.

v4 also fixes the issue with the missing assignments. I also added a few static code analyzers to hopefully prevent such blunders in the future.