improve audio monitor accuracy
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
bc70d51411
commit
99dc3b3e61
|
@ -13,7 +13,9 @@
|
|||
let bar;
|
||||
const tweenedProgress = tweened(0, { duration: 100, easing: quintOut });
|
||||
|
||||
$: $tweenedProgress = progress;
|
||||
if(bar){
|
||||
$tweenedProgress = (progress / 100) * bar.getBoundingClientRect().height;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div bind:this={bar} class="bar-container">
|
||||
|
@ -26,13 +28,13 @@
|
|||
bounds: "parent",
|
||||
onDragEnd: (e) => {
|
||||
let rect = bar.getBoundingClientRect();
|
||||
let y = e.domRect.y / (rect.height + rect.y);
|
||||
let y = ( e.domRect.y - rect.y + (e.domRect.height / 2)) / (rect.height);
|
||||
onSetpointChange(1.0 - y);
|
||||
},
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
<div class="bar" style="height: {$tweenedProgress}%;" />
|
||||
<div class="bar" style="height: {$tweenedProgress}px;" />
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
Loading…
Reference in New Issue