From 0b8e59a7e9ebc2090c57e38d31c2c032ad82a50e Mon Sep 17 00:00:00 2001 From: Andrio Celos Date: Mon, 19 Feb 2024 14:17:06 +1100 Subject: [PATCH] Add a space to card names to be included when copying it --- TableturfBattleClient/src/CardDisplay.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/TableturfBattleClient/src/CardDisplay.ts b/TableturfBattleClient/src/CardDisplay.ts index b14c1e0..3cd67a2 100644 --- a/TableturfBattleClient/src/CardDisplay.ts +++ b/TableturfBattleClient/src/CardDisplay.ts @@ -115,6 +115,15 @@ class CardDisplay implements ICardElement { tspan1.appendChild(document.createTextNode(card.line1)); text1.appendChild(tspan1); + if (!card.line1.endsWith('-') && !card.line2.startsWith('-')) { + // Add a space in the middle, to be included when copying the card name. + const tspanBr = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); + tspanBr.setAttribute('x', '50%'); + tspanBr.setAttribute('y', '169'); + tspanBr.appendChild(document.createTextNode(' ')); + text1.appendChild(tspanBr); + } + const tspan2 = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); tspan2.setAttribute('x', '50%'); tspan2.setAttribute('y', '216');