From 3ee06c0d1102a106b18b4b7fa755d861c4ad5cbf Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Wed, 22 May 2024 22:10:15 +0800 Subject: [PATCH 1/2] fix: dragging in the view area will skip certain values --- src/SplitPane.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SplitPane.vue b/src/SplitPane.vue index ac7e2964..44dfa25c 100644 --- a/src/SplitPane.vue +++ b/src/SplitPane.vue @@ -37,7 +37,7 @@ function dragMove(e: MouseEvent) { ? container.value.offsetHeight : container.value.offsetWidth const dp = position - startPosition - state.split = startSplit + ~~((dp / totalSize) * 100) + state.split = startSplit + Number(((dp / totalSize) * 100).toFixed(2)) } } From b54a0f09901f92962eec7888861b7bbbdbb4df7b Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Thu, 23 May 2024 05:46:26 +0800 Subject: [PATCH 2/2] Update src/SplitPane.vue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kevin Deng 三咲智子 --- src/SplitPane.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SplitPane.vue b/src/SplitPane.vue index 44dfa25c..79d0aa73 100644 --- a/src/SplitPane.vue +++ b/src/SplitPane.vue @@ -37,7 +37,7 @@ function dragMove(e: MouseEvent) { ? container.value.offsetHeight : container.value.offsetWidth const dp = position - startPosition - state.split = startSplit + Number(((dp / totalSize) * 100).toFixed(2)) + state.split = startSplit + +((dp / totalSize) * 100).toFixed(2) } }