diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-09 12:35:51 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-09 13:33:38 +0800 |
commit | 551c5c3fbe7163bc78e5159ddbc57967a0299e4e (patch) | |
tree | 77fe2706c080380f68d1433db5f4ccbaa8b82c73 /src | |
parent | 271d74d3bebdb84b368a6ad7bbcce2909642135b (diff) |
feat: patch 5aede26, set crosshair for maps
Diffstat (limited to 'src')
-rw-r--r-- | src/editor.mjs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index ba2799f..3714327 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
@@ -1098,6 +1098,7 @@ dumbyContainer.onmousedown = (e) => { | |||
1098 | lineEnd.style.left = event.clientX + 'px' | 1098 | lineEnd.style.left = event.clientX + 'px' |
1099 | lineEnd.style.top = event.clientY + 'px' | 1099 | lineEnd.style.top = event.clientY + 'px' |
1100 | line.position() | 1100 | line.position() |
1101 | dumbymap.utils.renderedMaps().forEach(map => { map.style.cursor = 'crosshair' }) | ||
1101 | } | 1102 | } |
1102 | 1103 | ||
1103 | dumbyContainer.onmousemove = onMouseMove | 1104 | dumbyContainer.onmousemove = onMouseMove |
@@ -1106,6 +1107,7 @@ dumbyContainer.onmousedown = (e) => { | |||
1106 | dumbyContainer.onmouseup = null | 1107 | dumbyContainer.onmouseup = null |
1107 | line?.remove() | 1108 | line?.remove() |
1108 | lineEnd.remove() | 1109 | lineEnd.remove() |
1110 | dumbymap.utils.renderedMaps().forEach(map => map.style.removeProperty('cursor')) | ||
1109 | 1111 | ||
1110 | const map = document.elementFromPoint(e.clientX, e.clientY).closest('.mapclay') | 1112 | const map = document.elementFromPoint(e.clientX, e.clientY).closest('.mapclay') |
1111 | const selection = cm.getSelection() | 1113 | const selection = cm.getSelection() |