Skip to content

Commit

Permalink
fix: touchscreen event in graphical Eq
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Nov 2, 2020
1 parent 2f9518c commit 54329f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/components/ChanStripFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,20 @@ class ChanStripFull extends React.PureComponent<
})
}

handleDragCaptureEq(key: number, event: MouseEvent) {
handleDragCaptureEq(key: number, event: any) {
let eqFreqKey =
fxParamsList[
String(fxParamsList[key]).replace(
'EqGain',
'EqFreq'
) as keyof typeof fxParamsList
]

this.handleFx(eqFreqKey, this.freqPositionToValue(event.clientX))
let eventX = event.clientX ?? event.touches[0].clientX
let eventY = event.clientY ?? event.touches[0].clientY
this.handleFx(eqFreqKey, this.freqPositionToValue(eventX))
this.handleFx(
key,
Math.round((100 * (EQ_Y_OFFSET - event.clientY)) / EQ_Y_SIZE) / 100
Math.round((100 * (EQ_Y_OFFSET - eventY)) / EQ_Y_SIZE) / 100
)
}

Expand Down

0 comments on commit 54329f2

Please sign in to comment.