Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(gates): an editor check may not read the display it happens to run on

yhh9aa1f8bcd3b0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3453745cd..9784af9f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -107,6 +107,14 @@ published separately; it ships inside the editor.
carries depth) and linear with layer 1 (capture built with depth) both drew red;
linear with no layer drew green.
+- **An editor check's verdict depended on it too.** The same fact one layer up:
+ a check reads coordinates off a screenshot, which is in device pixels, and
+ clicks in CSS ones — so at 150% scaling `icon-pick` clicked 1.5x away from the
+ icon and `gizmo-chrome` measured everything half again too big. The check
+ harness pins `device-scale-factor` to 1 for the editor it drives; a person
+ driving their own editor over MCP is untouched, because a real window's rect is
+ not zero and its scaling is the one they want. 33/34 with this, up from 31.
+
- **A pixel gate's verdict depended on the developer's monitor scaling.** The
headless render host never attaches its canvas to a document, so
`getBoundingClientRect()` is all zeros and `clientToScreen` reduces to
diff --git a/desktop/scripts/lib/editorDriver.mjs b/desktop/scripts/lib/editorDriver.mjs
index f74259f26..7b0d8932b 100644
--- a/desktop/scripts/lib/editorDriver.mjs
+++ b/desktop/scripts/lib/editorDriver.mjs
@@ -121,7 +121,15 @@ export async function withEditor(body, opts = {}) {
if ((opts.mode ?? 'editor') === 'editor') args.push('--editor');
const child = spawn(process.execPath, args, {
cwd: DESKTOP, stdio: ['pipe', 'pipe', 'pipe'],
- env: { ...process.env, ESTELLA_MCP_ALLOW_WRITES: '1' },
+ env: {
+ ...process.env,
+ ESTELLA_MCP_ALLOW_WRITES: '1',
+ // A check reads coordinates off a screenshot, which is in DEVICE pixels, and
+ // clicks in CSS ones. Only a scale of 1 makes those the same number, so
+ // without this a verdict is about the display the run happened to be on.
+ ESTELLA_MCP_EDITOR_ARGS: ['--force-device-scale-factor=1',
+ process.env.ESTELLA_MCP_EDITOR_ARGS ?? ''].join(' ').trim(),
+ },
});
let buf = '';