improve audio monitor accuracy
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Emerald 2022-09-13 02:03:09 +00:00
parent bc70d51411
commit 99dc3b3e61
1 changed files with 5 additions and 3 deletions

View File

@ -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">