rm dead code, workaround space+text3 inclusion in worker

This commit is contained in:
Stewart Allen 2025-12-26 10:40:14 -05:00
commit f7edbad51d
2 changed files with 6 additions and 43 deletions

View file

@ -407,56 +407,17 @@ function showVolume(bool) {
requestRefresh();
}
function canvasInMesh(w, h, textAlign, textBaseline, color, size) {
let canvas = document.createElement('canvas'),
canvasTexture = new THREE.CanvasTexture(canvas),
plane = new THREE.PlaneGeometry(w, h),
context = canvas.getContext('2d'),
scale = 8;
canvas.width = w * scale;
canvas.height = h * scale;
canvas.addEventListener("webglcontextlost", event => {
console.log('WEB GL CONTEXT LOST');
event.preventDefault();
}, false);
canvas.addEventListener("webglcontextrestored", event => {
console.log('WEB GL CONTEXT RESTORED');
}, false);
try {
context.scale(scale, scale);
} catch (e) {
console.log('unable to create label canvas', e ? e.name : 'unknown');
return {};
}
context.fillStyle = color || fontColor;
context.font = `${size}px sans-serif`;
context.textAlign = textAlign;
context.textBaseline = textBaseline;
canvasTexture.minFilter = THREE.LinearFilter;
// set 'transparent' to false to debug mesh bounds
let material = new THREE.MeshBasicMaterial({transparent: true, map: canvasTexture});
let mesh = new THREE.Mesh(plane, material);
return { context, mesh };
}
/**
* 3D text renderer for grid labels.
* Uses bitmap font atlas with shared geometries for memory efficiency.
*/
let text3d = new Text3D({
let text3d = self.document ? new Text3D({
chars: '0123456789-XY',
charSize: 64,
kerning: 0.6,
scaleX: 0.7,
fontFamily: "'Russo One', sans-serif"
});
}) : undefined;
function setRulers(
xon = ruler.xon,

View file

@ -420,6 +420,8 @@ details[open] summary::after {
}
.dark #rnfo {
color: #aaa;
border: 1px solid rgba(255,255,255,0.25);
background-color: rgba(0,0,0,0.75);
}
.dark #rnfo label {
color: #ada;
@ -2550,8 +2552,8 @@ details[open] summary::after {
bottom: 100%;
gap: 3px;
right: 0;
background-color: rgba(255,255,255,0.05);
border: 1px solid black;
background-color: rgba(255,255,255,0.75);
border: 1px solid rgba(0,0,0,0.5);
border-radius: 3px;
padding: 5px;
}