Replies: 2 comments 3 replies
-
I understand that you are trying to achieve a certain style and are modifying the CSS of a core wavesurfer element for that which messes with its internal workings. That’s why I was reluctant to expose the scrolling container but added it anyway because it was requested in a PR. I don’t consider this a bug and recommend styling only the outer wavesurfer container if possible. |
Beta Was this translation helpful? Give feedback.
-
@katspaugh sorry to bug you again, as indicated in my previous remark it is not possible to use only CSS to fix this. |
Beta Was this translation helpful? Give feedback.
-
Bug description
I want to create a certain effect where a region is drawn with a css
outline
, see screenshots below to get an idea of the desired effect. Basically the handles to manipulate the region size are drawn outside the actual region.This is proving to be a bit tricky because the wavesurfer
scroll
container hasoverflow:hidden
or:auto
, to make the scrolling work (obviously), which clips off theoutline
rectangle.When I try to get the effect by adding a
padding
to thescroll
container, it almost works except for one thing: the actualcanvas
element width is calculated with the 'old' width of thescroll
container, to be more precise theclientWidth
of thescroll
container is used quite a few times inrenderer.ts
. AndclientWidth
includes thepadding
. So there is a little 'tail' where the canvas is drawn a bit wider, padding-left + padding-right, than the actual container.I apologise if this is not considered an actual bug, guess it can be debatable, but still: the 'drawable width' of the
scroll
container can not be assumed to be the same as itsclientWidth
.Environment
Minimal code snippet
Expected result
The
canvas
is drawn inside thescroll
container.Obtained result
The
canvas
is drawn outside thescroll
containerScreenshots
In this screenshot the
canvas
element is highlighted in element inspector.You can see it is a little bit wider than the wrappers above it (when completely zoomed out), in this case
2*12px = 24px
.Beta Was this translation helpful? Give feedback.
All reactions