Skip to content

Commit

Permalink
fix: KCompass throws an error when clicking on it (close #878)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Jun 13, 2024
1 parent 1ad79fb commit 8b4ff1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion map/client/components/KCompass.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@touchstart="onStartDrag"
style="position: relative"
>
<svg width="100%" heigh="100%" viewBox="0 0 100 100" onclick="computeDirection">
<svg width="100%" heigh="100%" viewBox="0 0 100 100">
<circle
cx="50" cy="50" r="44"
:stroke="getCssVar('accent')"
Expand Down Expand Up @@ -143,6 +143,8 @@ function getPrefix () {
return i18n.t('KCompass.FROM')
}
function onStartDrag (event) {
const { x, y } = event
computeDirection(x, y)
window.addEventListener('mousemove', onHandleDrag)
window.addEventListener('touchmove', onHandleDrag)
window.addEventListener('mouseup', onStropDrag)
Expand Down

0 comments on commit 8b4ff1b

Please sign in to comment.