Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimelinePlugin insertPosition: 'beforebegin' does not respect boundaries with high peaks #3551

Open
mvynhb opened this issue Feb 13, 2024 · 0 comments · Fixed by #3618
Open
Labels

Comments

@mvynhb
Copy link

mvynhb commented Feb 13, 2024

Bug description

When using peaks that vary from 0.1 to 1 the top boundaries are not respected, and the waveform overflows into the labels.

Environment

  • Browser: Chrome

Minimal code snippet

const topTimeline = TimelinePlugin.create({
  height: 20,
  insertPosition: 'beforebegin',
  style: {
    fontSize: '20px',
  },
})

// Create a second timeline
const bottomTimline = TimelinePlugin.create({
  height: 20,
  style: {
    fontSize: '20px',
  },
})

// Create an instance of WaveSurfer
const wavesurfer = WaveSurfer.create({
  container: '#waveform',
  waveColor: 'rgb(200, 0, 200)',
  progressColor: 'rgb(100, 0, 100)',
  url: '/examples/audio/audio.wav',
  plugins: [topTimeline, bottomTimline],
  peaks:     [
      0.1, 1
    ],
})

Can easily test here: https://wavesurfer.xyz/examples/?timeline-custom.js

Expected result

Top waveform should not overflow labels.

Obtained result

Waveform is overflowing labels.

Screenshots

2024-02-13_10-45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants