Web Dev Solutions

Catalin Mititiuc

From 96e6f8a09afaf7bc729b7e14eb0d72dd372ca9fd Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Tue, 23 Apr 2024 21:14:30 -0700 Subject: WIP: sight line and trace working again --- src/modules/counter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/counter.js') 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 { -- cgit v1.2.3