Skip to content

Commit

Permalink
fix: Layout rotation fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Aug 8, 2024
1 parent 6ea574d commit 4e53eaf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/keyboard/Keymap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const Keymap = ({
y: k.y / 100.0,
width: k.width / 100,
height: k.height / 100.0,
r: k.r / 100.0,
r: (k.r || 0) / 100.0,
rx: (k.rx || 0) / 100.0,
ry: (k.ry || 0) / 100.0,
children: <span>{label}</span>,
Expand Down
3 changes: 3 additions & 0 deletions src/keyboard/PhysicalLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export type KeyPosition = PropsWithChildren<{
height: number;
x: number;
y: number;
r?: number;
rx?: number;
ry?: number;
}>;

interface PhysicalLayoutProps {
Expand Down
17 changes: 11 additions & 6 deletions src/keyboard/PhysicalLayoutPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,17 @@ export const PhysicalLayoutPicker = ({
<PhysicalLayout
oneU={15}
hoverZoom={false}
positions={l.keys.map(({ x, y, width, height }) => ({
x: x / 100.0,
y: y / 100.0,
width: width / 100.0,
height: height / 100.0,
}))}
positions={l.keys.map(
({ x, y, width, height, r, rx, ry }) => ({
x: x / 100.0,
y: y / 100.0,
width: width / 100.0,
height: height / 100.0,
r: (r || 0) / 100.0,
rx: (rx || 0) / 100.0,
ry: (ry || 0) / 100.0,
})
)}
/>
</div>
</ListBoxItem>
Expand Down

0 comments on commit 4e53eaf

Please sign in to comment.