--- a/src/Tools/VSCode/extension/media/main.js Mon May 27 13:20:31 2024 +0200
+++ b/src/Tools/VSCode/extension/media/main.js Mon May 27 13:21:15 2024 +0200
@@ -25,14 +25,14 @@
vscode.postMessage({'command': 'locate'});
});
+ const test_string = "mix";
+ const test_span = document.createElement("span");
+ test_span.textContent = test_string;
+ document.body.appendChild(test_span);
+ const symbol_width = test_span.getBoundingClientRect().width / test_string.length;
+ document.body.removeChild(test_span);
+
const get_window_margin = () => {
- const test_string = "mix";
- const test_span = document.createElement("span");
- test_span.textContent = test_string;
- document.body.appendChild(test_span);
- const symbol_width = test_span.getBoundingClientRect().width / test_string.length;
- document.body.removeChild(test_span);
-
const width = window.innerWidth / symbol_width;
const result = Math.max(width - 16, 1); // extra headroom
return result;