What about height alignment? #2810
letavocado
started this conversation in
Ideas
Replies: 3 comments 7 replies
-
For height alignment //...
if (barIndex > prevX) {
const leftBarHeight = Math.round(prevLeft * halfHeight * barScale)
const rightBarHeight = Math.round(prevRight * halfHeight * barScale)
const barHeight = leftBarHeight + (rightBarHeight || 1)
ctx.roundRect(
prevX * (barWidth + barGap),
options.alignEnd ? height - barHeight : halfHeight - leftBarHeight,
barWidth,
barHeight,
barRadius
)
//... p.s. upd |
Beta Was this translation helpful? Give feedback.
0 replies
-
The proposed options makes sense. I suggest we call it |
Beta Was this translation helpful? Give feedback.
5 replies
-
I guess we should add a warning if the bar's height greater than the canvas's height. What do you think? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Height alignment is useful for implementing such examples.
Possible solution:
from:
wavesurfer.js/src/renderer.ts
Lines 288 to 294 in c8ff5a3
to:
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions