forked from 1b-agent/opencadstudio-upstream
Upstream issues, fixed: #1345 — hatches plotted at draw_depth 0.0: the plot path cloned models from the hatch cache, which bakes the depth at seed time; the canvas re-reads the live depth map every frame, which is why the editor was right and every export (PDF and native printing — both route through the exporter) was wrong, with hatch-vs-hatch ties broken by HashMap order. The plot path now re-reads the depth map per entity, and the exporter's tie-break ranks follow the editor's own pass order (hatch < image < wire fill < wire < text < wipeout) instead of pinning hatches between fills and wires. Pinned by content-stream operator- order tests (back/front hatches, overlapping hatches, interleaved wire-between-hatches) and a scene test that fails pre-fix. #1348 — set_properties' optimistic-concurrency compare now matches numbers by value (10.0 == 10) through json_values_match, compatible with the shape of upstream PR #1350; nested objects/arrays recurse. #1349 — web automation contract: control protocol 2 (v1 clients still accepted) adds {op:'open', name, data_base64} routed through the guarded open queue; window.ocsControl.ready/request promise wrapper with an ocs-ready event (web/ocs-control.js); the startup donation prompt is suppressed once a control request is seen (opt-in pre-boot via localStorage); docs/automation documents the whole web contract. Also: DATALINK CSV-to-table works on web (picker + bytes through the session registry — was std::fs, silently dead); COLORSCHEME accepts System (prefers-color-scheme on web, AppsUseLightTheme on Windows). Decode accounting, made honest per the fix-of-fix review: into_rgba8 allocates the RGBA destination while the native buffer is alive for every non-Rgba8 layout (L8 5, La8 6, Rgb8 7, L16 6, La16 8 B/px peaks — the formula now says so), GIF bills the screen+frame coexistence at 8 B/px, and TIFF drops the 3x multipliers both ways — tiff 0.11 splits the given budget between frame and scratch (a total ceiling), so the old double-billing refused honest 16-bit GeoTIFFs ~2.25x early while admitting hostile chunk transients at 3x. The image-refusal-unknown-size locale key moves to the group the catalog always claimed (file).
101 lines
4.0 KiB
HTML
101 lines
4.0 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="robots" content="noindex, follow" />
|
|
<meta name="theme-color" content="#1e1e1e" />
|
|
<title>Open CAD Studio Web App</title>
|
|
<link data-trunk rel="icon" href="assets/logo.svg" />
|
|
<style>
|
|
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #1e1e1e; }
|
|
canvas { display: block; }
|
|
#loading {
|
|
position: fixed;
|
|
inset: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 22px;
|
|
background: #1e1e1e;
|
|
color: #cfcfcf;
|
|
font-family: system-ui, sans-serif;
|
|
z-index: 9999;
|
|
transition: opacity 0.4s ease;
|
|
}
|
|
#loading.hide { opacity: 0; pointer-events: none; }
|
|
#loading .title { font-size: 22px; font-weight: 600; letter-spacing: 0.5px; }
|
|
#loading .title span { color: #3399e6; }
|
|
#loading .sub { font-size: 12px; color: #777; }
|
|
#loading .spinner {
|
|
width: 46px;
|
|
height: 46px;
|
|
border: 4px solid #2e2e2e;
|
|
border-top-color: #3399e6;
|
|
border-radius: 50%;
|
|
animation: ocs-spin 0.9s linear infinite;
|
|
}
|
|
@keyframes ocs-spin { to { transform: rotate(360deg); } }
|
|
</style>
|
|
<link data-trunk rel="rust" data-bin="OpenCADStudio" />
|
|
<link data-trunk rel="copy-dir" href="web/fonts" />
|
|
<link data-trunk rel="copy-file" href="web/ocs-parse-worker.js" />
|
|
<link data-trunk rel="copy-file" href="web/discussions.json" />
|
|
<link data-trunk rel="copy-file" href="web/videos.json" />
|
|
<link data-trunk rel="copy-file" href="web/locale-labels.json" />
|
|
<link data-trunk rel="copy-file" href="web/ocs-control.js" />
|
|
</head>
|
|
<body>
|
|
<div id="loading">
|
|
<div class="spinner"></div>
|
|
<div class="title">Open <span>CAD</span> Studio</div>
|
|
<div class="sub">Loading…</div>
|
|
</div>
|
|
<script src="ocs-control.js" defer></script>
|
|
<script>
|
|
(() => {
|
|
const splash = document.getElementById("loading");
|
|
fetch("locale-labels.json").then(response => response.json()).then(labels => {
|
|
let saved;
|
|
try {
|
|
saved = JSON.parse(localStorage.getItem("opencadstudio.settings"))?.settings?.language;
|
|
} catch {}
|
|
const preferred = navigator.languages?.length ? navigator.languages : [navigator.language];
|
|
const requested = typeof saved === "string" && saved !== "system" ? [saved, ...preferred] : preferred;
|
|
const available = Object.keys(labels);
|
|
let locale = "en-US";
|
|
for (const candidate of requested) {
|
|
try {
|
|
const language = new Intl.Locale(candidate);
|
|
const match = available.find(value => value.toLowerCase() === language.baseName.toLowerCase())
|
|
|| (language.language === "zh"
|
|
? (language.maximize().script === "Hant" ? "zh-TW" : "zh-CN")
|
|
: available.find(value => value.startsWith(language.language + "-")));
|
|
if (match) { locale = match; break; }
|
|
} catch {}
|
|
}
|
|
document.title = labels[locale].title;
|
|
document.documentElement.lang = locale;
|
|
document.documentElement.dir = locale === "ar-SA" ? "rtl" : "ltr";
|
|
const caption = splash?.querySelector(".sub");
|
|
if (caption) caption.textContent = labels[locale].loading;
|
|
}).catch(() => {});
|
|
const done = () => {
|
|
if (!splash) return;
|
|
splash.classList.add("hide");
|
|
setTimeout(() => splash.remove(), 450);
|
|
};
|
|
if (document.querySelector("canvas")) return done();
|
|
const observer = new MutationObserver(() => {
|
|
if (document.querySelector("canvas")) {
|
|
observer.disconnect();
|
|
done();
|
|
}
|
|
});
|
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|