Skip to content

Commit

Permalink
Merge pull request #938 from Dygmalab/fixLayoutEditorDeselectKey
Browse files Browse the repository at this point in the history
fix: clicking in a selected key deselects it in layout editor
  • Loading branch information
alexpargon authored Nov 13, 2024
2 parents 131769a + e173743 commit b908884
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/renderer/views/LayoutEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,11 @@ const LayoutEditor = (props: LayoutEditorProps) => {
const keyIndex = parseInt(currentTarget.getAttribute("data-key-index"), 10);
const ledIndex = parseInt(currentTarget.getAttribute("data-led-index"), 10);

if (keyIndex === currentKeyIndex) {
setCurrentKeyIndex(-1);
return;
}

setCurrentLayer(layer);
if (colorMap.length > 0 && layer >= 0 && layer < colorMap.length) {
setCurrentKeyIndex(keyIndex);
Expand Down

0 comments on commit b908884

Please sign in to comment.