Skip to content

Commit a8b1f15

Browse files
authoredSep 18, 2023
fix(mac): Enhance the usage boundary of iconTextSize (#7769) (#7780)
1 parent 21f3069 commit a8b1f15

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

‎.changeset/funny-geckos-clap.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"dmg-builder": patch
3+
---
4+
5+
fix(mac): Validate the usage boundary of iconTextSize (#7769)

‎packages/dmg-builder/src/dmg.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,14 @@ async function computeAssetSize(cancellationToken: CancellationToken, dmgFile: s
241241

242242
async function customizeDmg(volumePath: string, specification: DmgOptions, packager: MacPackager, backgroundFile: string | null | undefined) {
243243
const window = specification.window
244+
const isValidIconTextSize = !!specification.iconTextSize && specification.iconTextSize >= 10 && specification.iconTextSize <= 16
245+
const iconTextSize = isValidIconTextSize ? specification.iconTextSize : 12;
244246
const env: any = {
245247
...process.env,
246248
volumePath,
247249
appFileName: `${packager.appInfo.productFilename}.app`,
248250
iconSize: specification.iconSize || 80,
249-
iconTextSize: specification.iconTextSize || 12,
251+
iconTextSize,
250252

251253
PYTHONIOENCODING: "utf8",
252254
}

0 commit comments

Comments
 (0)
Please sign in to comment.