feat: update theme toggle button text and adjust UV mapping threshold for improved rendering

This commit is contained in:
CNCKitchen
2026-03-18 12:21:53 +01:00
parent d09d00e5a8
commit ac598757f0
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -32,8 +32,8 @@
<span>CNC Kitchen STL Texturizer</span>
</div>
<button id="theme-toggle" class="theme-toggle" title="Toggle light / dark mode" aria-label="Toggle light/dark mode" style="margin-left:auto">
<span class="icon-moon">Dark</span>
<span class="icon-sun">Light</span>
<span class="icon-moon">Dark Theme</span>
<span class="icon-sun">Light Theme</span>
</button>
</header>
+1 -1
View File
@@ -65,7 +65,7 @@ export function computeUV(pos, normal, mode, settings, bounds) {
const C = TWO_PI * Math.max(r, 1e-6);
const rx = pos.x - center.x;
const ry = pos.y - center.y;
if (Math.abs(normal.z) > 0.5) {
if (Math.abs(normal.z) > 0.7) {
// Cap face — normalise by C so one tile = same world size as on the side
u = rx / C + 0.5;
v = ry / C + 0.5;
+1 -1
View File
@@ -97,7 +97,7 @@ const fragmentShader = /* glsl */`
// fills the diameter × diameter square so the disc looks fully textured.
float r = max(boundsSize.x, boundsSize.y) * 0.5;
float C = TWO_PI * max(r, 1e-4);
if (abs(vModelNormal.z) > 0.5) {
if (abs(vModelNormal.z) > 0.7) {
// Cap face — normalise by C so one tile = same world size as on the side
return sampleMap(vec2(
rel.x / C + 0.5,