From 43015bc4ccedbbfa4bc88c0b2cb92afd6ee01225 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 5 Jun 2026 09:43:38 -0700 Subject: [PATCH] electron: lock desktop density to 1 + make boot animation track ac-density - bios.mjs: desktop default density back to 1. - index.mjs boot canvas: in Electron, read ac-density from localStorage and use it for SCL + targetSCL so the boot animation's pixel grid + element scale match the main canvas density. Browser boot unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- system/netlify/functions/index.mjs | 7 +++++-- system/public/aesthetic.computer/bios.mjs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/system/netlify/functions/index.mjs b/system/netlify/functions/index.mjs index aeeec28bd..a10c238ac 100644 --- a/system/netlify/functions/index.mjs +++ b/system/netlify/functions/index.mjs @@ -1312,12 +1312,15 @@ async function fun(event, context) { var bootTheme=params.get('boot')||'serious';var isSerious=bootTheme==='serious'; // Density param for scaling (default 1, FF1 uses 8 for 4K) var densityMatch=qs.match(/density=(\d+)/);var densityParam=densityMatch?parseInt(densityMatch[1]):1; + // In the Electron desktop app, follow the runtime's ac-density so the boot + // animation's pixel grid matches the main canvas (browser: unchanged). + var acDensity;try{acDensity=(window.acElectron&&parseInt(localStorage.getItem('ac-density')))||densityParam||1;}catch(e){acDensity=densityParam||1;} var isLightMode=window.matchMedia&&window.matchMedia('(prefers-color-scheme:light)').matches; // Device mode with density=1 uses lower targetSCL for performance - var baseTargetSCL=3;var targetSCL=isDeviceMode&&densityParam===1?1:baseTargetSCL; + var baseTargetSCL=3;var targetSCL=window.acElectron?Math.max(1,acDensity):(isDeviceMode&&densityParam===1?1:baseTargetSCL); // Use visualViewport API for accurate sizing on iOS (avoids browser chrome issues) function getViewportSize(){var vv=window.visualViewport;return{w:vv?vv.width:window.innerWidth,h:vv?vv.height:window.innerHeight};} - var vp=getViewportSize();var SCL=1,W=Math.ceil(vp.w/SCL),H=Math.ceil(vp.h/SCL);c.width=W;c.height=H; + var vp=getViewportSize();var SCL=acDensity,W=Math.ceil(vp.w/SCL),H=Math.ceil(vp.h/SCL);c.width=W;c.height=H; function updateCanvasSize(){var vp=getViewportSize();W=Math.ceil(vp.w/SCL);H=Math.ceil(vp.h/SCL);c.width=W;c.height=H;c.style.width=vp.w+'px';c.style.height=vp.h+'px';x.imageSmoothingEnabled=false;} function updateScale(newSCL){SCL=newSCL;updateCanvasSize();for(var k in scrollYs)scrollYs[k]=0;} window.addEventListener('resize',updateCanvasSize); diff --git a/system/public/aesthetic.computer/bios.mjs b/system/public/aesthetic.computer/bios.mjs index 6dcb10676..ad811556a 100644 --- a/system/public/aesthetic.computer/bios.mjs +++ b/system/public/aesthetic.computer/bios.mjs @@ -1249,7 +1249,7 @@ async function boot(parsed, bpm = 60, resolution, debug) { ? resolution.density : (window.acPACK_DENSITY !== undefined ? window.acPACK_DENSITY - : (window.acElectron ? 3 : 2)); + : (window.acElectron ? 1 : 2)); // acFORCE_NOGAP pins gap=0 for packed M4L bundles loaded via data: URI // where there's no `?nogap` query param to read — equivalent behavior. -- 2.51.2