Browse Source

Add width dependency

This is to cover repainting of keys using the widths.
master
TheoryOfNekomata 4 years ago
parent
commit
c7be66173a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/components/Keyboard/Keyboard.tsx

+ 2
- 2
src/components/Keyboard/Keyboard.tsx View File

@@ -82,8 +82,8 @@ const Keyboard: React.FC<Props> = ({


const { natural: NaturalKey = DefaultNaturalKey, accidental: AccidentalKey = DefaultAccidentalKey } = keyComponents! const { natural: NaturalKey = DefaultNaturalKey, accidental: AccidentalKey = DefaultAccidentalKey } = keyComponents!


const getKeyWidth = React.useCallback((k) => getKeyWidthUnmemoized(startKey, endKey)(k), [startKey, endKey])
const getKeyLeft = React.useCallback((k) => getKeyLeftUnmemoized(startKey, endKey)(k), [startKey, endKey])
const getKeyWidth = React.useCallback((k) => getKeyWidthUnmemoized(startKey, endKey)(k), [startKey, endKey, width])
const getKeyLeft = React.useCallback((k) => getKeyLeftUnmemoized(startKey, endKey)(k), [startKey, endKey, width])
const isNaturalKey = React.useCallback((k) => isNaturalKeyUnmemoized(k), []) const isNaturalKey = React.useCallback((k) => isNaturalKeyUnmemoized(k), [])


React.useEffect(() => { React.useEffect(() => {


Loading…
Cancel
Save