|
228 | 228 | parent.replaceChild(frag, textNode); |
229 | 229 | }); |
230 | 230 |
|
231 | | - // Debug: log labelBox SVG structure to console for inspection. |
232 | | - svg.querySelectorAll(".labelBox").forEach(function(box, i) { |
233 | | - var g = box.closest("g"); |
234 | | - if (!g) return; |
235 | | - var text = g.querySelector(".labelText"); |
236 | | - if (!text) return; |
237 | | - console.log("labelBox[" + i + "]:", { |
238 | | - boxY: box.getAttribute("y"), |
239 | | - boxH: box.getAttribute("height"), |
240 | | - boxW: box.getAttribute("width"), |
241 | | - textY: text.getAttribute("y"), |
242 | | - textDY: text.getAttribute("dy"), |
243 | | - textDomBaseline: text.getAttribute("dominant-baseline"), |
244 | | - textBBox: text.getBBox(), |
245 | | - tspans: Array.from(text.querySelectorAll("tspan")).map(function(ts) { |
246 | | - return { y: ts.getAttribute("y"), dy: ts.getAttribute("dy"), text: ts.textContent }; |
247 | | - }), |
248 | | - outerHTML: g.outerHTML.substring(0, 500) |
249 | | - }); |
250 | | - }); |
251 | | - |
252 | 231 | // Widen note rects when monospace text overflows the original box. |
253 | 232 | svg.querySelectorAll(".note").forEach(function(noteRect) { |
254 | 233 | var g = noteRect.closest("g"); |
|
275 | 254 | rect.style.fill = "var(--rect-fill)"; |
276 | 255 | } |
277 | 256 | }); |
| 257 | + // Debug: log labelBox SVG structure to console for inspection. |
| 258 | + svg.querySelectorAll(".labelBox").forEach(function(box, i) { |
| 259 | + var g = box.closest("g"); |
| 260 | + if (!g) return; |
| 261 | + var text = g.querySelector(".labelText"); |
| 262 | + if (!text) return; |
| 263 | + console.log("labelBox[" + i + "]:", { |
| 264 | + boxY: box.getAttribute("y"), |
| 265 | + boxH: box.getAttribute("height"), |
| 266 | + boxW: box.getAttribute("width"), |
| 267 | + textY: text.getAttribute("y"), |
| 268 | + textDY: text.getAttribute("dy"), |
| 269 | + textBBox: text.getBBox(), |
| 270 | + tspans: Array.from(text.querySelectorAll("tspan")).map(function(ts) { |
| 271 | + return { y: ts.getAttribute("y"), dy: ts.getAttribute("dy"), text: ts.textContent }; |
| 272 | + }), |
| 273 | + outerHTML: g.outerHTML.substring(0, 500) |
| 274 | + }); |
| 275 | + }); |
278 | 276 | }); |
279 | 277 | </script> |
280 | 278 |
|
|
0 commit comments