From 4523417309e56285e41dab715c748022fab13224 Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Tue, 22 Oct 2024 11:27:12 +0100 Subject: [PATCH] Fixed knob issue --- packages/primevue/src/knob/Knob.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/primevue/src/knob/Knob.vue b/packages/primevue/src/knob/Knob.vue index f5ed9cffd..25a1bd312 100644 --- a/packages/primevue/src/knob/Knob.vue +++ b/packages/primevue/src/knob/Knob.vue @@ -48,7 +48,7 @@ export default { }; }, methods: { - updateValue(offsetX, offsetY) { + updateValueByOffset(offsetX, offsetY) { let dx = offsetX - this.size / 2; let dy = this.size / 2 - offsetY; let angle = Math.atan2(dy, dx); @@ -78,7 +78,7 @@ export default { }, onClick(event) { if (!this.disabled && !this.readonly) { - this.updateValue(event.offsetX, event.offsetY); + this.updateValueByOffset(event.offsetX, event.offsetY); } }, onBlur(event) { @@ -114,7 +114,7 @@ export default { }, onMouseMove(event) { if (!this.disabled && !this.readonly) { - this.updateValue(event.offsetX, event.offsetY); + this.updateValueByOffset(event.offsetX, event.offsetY); event.preventDefault(); } }, @@ -125,7 +125,7 @@ export default { const offsetX = touch.clientX - rect.left; const offsetY = touch.clientY - rect.top; - this.updateValue(offsetX, offsetY); + this.updateValueByOffset(offsetX, offsetY); } }, onKeyDown(event) {