Skip to content

fix(installer): Mac DMG 窗口拉大后背景延展铺满,不再露白边(dev-board#580) - #804

Merged
zeweihan merged 1 commit into
masterfrom
claude/dmg-background-bleed-580
Sep 10, 2026
Merged

fix(installer): Mac DMG 窗口拉大后背景延展铺满,不再露白边(dev-board#580)#804
zeweihan merged 1 commit into
masterfrom
claude/dmg-background-bleed-580

Conversation

@zeweihan

Copy link
Copy Markdown
Owner

问题

dev-board#580:Mac DMG 安装窗口被拖大后,背景图不跟随,右侧和下方露出大片白边。

根因

Finder 按背景图原尺寸贴在窗口左上角,不拉伸不平铺,图外一律涂白。原背景只有 660x420。

修法

  • 桌面端 desktop/build/dmg-background.html 与插件端 office-addin/installer/art/dmg-background.html:画布扩到 3840x2160(覆盖 4K「更多空间」),渐变改用 px 定位让左上 660x420 主体原位不动,绿带与走线横向延续;四张 PNG 重新渲染入库。
  • desktop/package.json 显式写 dmg.window: 660x420(electron-builder 默认拿背景尺寸当窗口尺寸)。
  • 插件端 render-art.mjs 渲染尺寸同步;eng-infra.md 记一笔。

验证

  • 真 DMG(本仓 electron-builder 24.13.3 dmg 目标 + dummy app;插件端按 build-installers.mjs 同流程)挂载,osascript 设窗口 bounds,screencapture -R 数内容区纯白像素:
    • 桌面 默认 3.04% → 3.04%(不变);拉大 78.9% → 0.52%
    • 插件 默认 5.59% → 5.59%(不变);拉大 79.4% → 1.02%
  • 左上 660x420 与旧图 AE 比对最大差 1/255(取整)。
  • DMG 体积:桌面 1.01MB → 2.51MB,插件 0.88MB → 2.38MB(空壳 DMG 口径,增量约 1.5MB)。

未验证

  • 未跑真实完整桌面打包与插件 build-installers.mjs 全流程(签名/公证),DMG 步骤为同配置复现。
  • 仅在一台 1920x1080pt 显示器上实测。

🤖 Generated with Claude Code

Finder 按原尺寸把背景贴在左上角、图外涂白,窗口一拉大就露白。桌面端与
Office/WPS 插件端两个 DMG 的背景画布扩到 3840x2160(2x 7680x4320),设计主体
仍在左上 660x420 原位不动(改前改后裁切比对最大差 1/255),延展区延续同一套渐变与
绿带;桌面端显式写 dmg.window 660x420,否则 electron-builder 拿背景尺寸当窗口尺寸。

实测(真 DMG + Finder osascript 拉到 1600x962 + screencapture 数白像素):
桌面 78.9% → 0.52%,插件 79.4% → 1.0%(剩余是图标光晕本身);默认窗口数值不变。
DMG 体积各约 +1.5MB。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@zeweihan
zeweihan merged commit f99b811 into master Sep 10, 2026
9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant