Skip to content

Commit 3ffa034

Browse files
committed
fix(LFO): fix square wave display issue caused by calculations
1 parent af22277 commit 3ffa034

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/components/visualization/LFO

packages/components/visualization/LFO/LFO.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ export const LFO = forwardRef<LFORef, LFOProps>((props, ref) => {
129129

130130
const center = (max + min) / 2
131131
const halfHeight = ((max - min) * frequency) / 2
132+
132133
const data = [{ x: 0, y: center }].concat(
133134
d3.range(0, 4 * Math.PI * (speed * 10), 0.01).map((x) => {
134-
const y =
135-
Math.floor(x / (Math.PI / 2)) % 2 === 0 ? center + halfHeight : center - halfHeight
135+
const y = Math.floor(x / Math.PI) % 2 === 0 ? center + halfHeight : center - halfHeight
136136
return { x, y }
137137
}),
138138
)

0 commit comments

Comments
 (0)