mirror of
https://github.com/hansjone/netx.git
synced 2026-10-15 18:23:18 +08:00
Login starfield: skip painting on a zero-size viewport.
A hidden pane reports 0x0, which made the band direction NaN and createRadialGradient throw, replacing the login page with the error boundary. Wait for a resize with a real size instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e8f77440ca
commit
d8da7acb7d
1 changed files with 2 additions and 0 deletions
|
|
@ -175,6 +175,8 @@ export function LoginStarfield() {
|
|||
const dpr = Math.min(window.devicePixelRatio || 1, 2);
|
||||
const w = window.innerWidth;
|
||||
const h = window.innerHeight;
|
||||
// Hidden/zero-size viewport: gradients would get NaN coords and throw. Wait for a resize.
|
||||
if (!(w >= 1 && h >= 1 && Number.isFinite(w) && Number.isFinite(h))) return;
|
||||
sky.width = Math.round(w * dpr);
|
||||
sky.height = Math.round(h * dpr);
|
||||
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue