Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-23 21:14:30 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-23 21:14:30 -0700
commit96e6f8a09afaf7bc729b7e14eb0d72dd372ca9fd (patch)
tree2e916cb653ec260905e5773aaf056f6c8a9cfb8f /src/modules/counter.js
parentf60969ef8dc72d3b97c5abb9f637171d2a6f2921 (diff)
WIP: sight line and trace working again
Diffstat (limited to 'src/modules/counter.js')
-rw-r--r--src/modules/counter.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/counter.js b/src/modules/counter.js
index 162e56e..21a0238 100644
--- a/src/modules/counter.js
+++ b/src/modules/counter.js
@@ -44,6 +44,9 @@ export default class Counter {
return this.svg.querySelectorAll(`use[data-allegiance="${al}"][data-number="${n}"]`);
}
+ getTrace({ dataset: { allegiance, number } }) {
+ return this.svg.querySelector(this.traceSelector(number, allegiance));
+ }
getCellPosition(cell) {
let pt = new DOMPoint(0, 0),
@@ -144,9 +147,6 @@ export default class Counter {
const counter = this.getCounter(troopAllegiance, troopNumber),
lockedSl = this.svg.querySelector('.sight-line:not(.active)');
- counter.setAttributeNS(null, 'x', 0);
- counter.setAttributeNS(null, 'y', 0);
-
if (!lockedSl) {
this.container.sightLine.clear();
} else {