Skip to content

Commit

Permalink
Pluralize cents property in virtual keyboard key info
Browse files Browse the repository at this point in the history
  • Loading branch information
frostburn committed Apr 27, 2024
1 parent 60724db commit c92d82e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/components/VirtualKeyInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { formatHertz, formatExponential, formatCents } from '@/utils'
const props = defineProps<{
label: string
cent: number
cents: number
ratio: number
frequency: number
showLabel: boolean
showCent: boolean
showCents: boolean
showRatio: boolean
showFrequency: boolean
}>()
Expand All @@ -18,7 +18,7 @@ const props = defineProps<{
<div v-if="props.showLabel">
<strong>{{ props.label }}</strong>
</div>
<div v-if="props.showCent">{{ formatCents(props.cent, 0) }}</div>
<div v-if="props.showCents">{{ formatCents(props.cents, 0) }}</div>
<div v-if="props.showRatio">{{ formatExponential(props.ratio) }}</div>
<div v-if="props.showFrequency">{{ formatHertz(props.frequency) }}</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/components/VirtualKeyboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const props = defineProps<{
colorMap: ColorMap
labelMap: LabelMap
showLabel: boolean
showCent: boolean
showCents: boolean
showRatio: boolean
showFrequency: boolean
}>()
Expand All @@ -32,7 +32,7 @@ type VirtualKey = {
index: number
color: string
frequency: number
cent: number
cents: number
ratio: number
label: string
}
Expand All @@ -48,7 +48,7 @@ const virtualKeys = computed(() => {
const index = props.baseIndex + x * horizontal + y * vertical
const color = props.colorMap(index)
const frequency = props.frequencies[index]
const cent = props.centss[index]
const cents = props.centss[index]
const ratio = frequency * inverseBaseFreq
const label = props.labelMap(index)
row.push({
Expand All @@ -57,7 +57,7 @@ const virtualKeys = computed(() => {
index,
color,
frequency,
cent,
cents,
ratio,
label
})
Expand Down Expand Up @@ -89,11 +89,11 @@ const isMousePressed = ref(false)
>
<VirtualKeyInfo
:label="key.label"
:cent="key.cent"
:cents="key.cents"
:ratio="key.ratio"
:frequency="key.frequency"
:showLabel="props.showLabel"
:showCent="props.showCent"
:showCents="props.showCents"
:showRatio="props.showRatio"
:showFrequency="props.showFrequency"
/>
Expand Down

0 comments on commit c92d82e

Please sign in to comment.