diff --git a/apps/photocraft/src/app_icon.rs b/apps/photocraft/src/app_icon.rs index 90ce94ea04..72ca7a6026 100644 --- a/apps/photocraft/src/app_icon.rs +++ b/apps/photocraft/src/app_icon.rs @@ -15,7 +15,7 @@ //! be stamped on the shortcut, or the taskbar would stop matching the two. /// Window, taskbar and (when running unbundled) Dock icon. macOS gets the padded 1024 px render -/// on Apple's icon grid; elsewhere the tighter 256 px hicolor render reads better at small sizes. +/// on Apple's icon grid; elsewhere the 256 px hicolor render of the full tile. pub fn window_icon() -> egui::IconData { match eframe::icon_data::from_png_bytes(PNG) { Ok(icon) => icon, @@ -53,6 +53,16 @@ mod tests { assert!(icon.rgba.chunks(4).any(|p| p[3] > 0), "the icon isn't blank"); } + #[test] + fn windows_and_linux_icons_keep_the_round_corners() { + // rx=112 of 512 leaves (10, 10) of a 256 px render transparent; the old crop filled it (#4478). + let png = include_bytes!("../../../assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png"); + let icon = eframe::icon_data::from_png_bytes(png).unwrap(); + assert_eq!(icon.width, 256); + assert_eq!(icon.rgba[(10 * 256 + 10) * 4 + 3], 0, "corner is transparent"); + assert_eq!(icon.rgba[(128 * 256 + 2) * 4 + 3], 255, "the tile is full bleed"); + } + /// The `.ico` build.rs embeds: every size Windows asks for, each a valid PNG or BMP image. #[test] fn exe_icon_has_every_shell_size() { diff --git a/assets/app-icon/README.md b/assets/app-icon/README.md index 8ddb66f093..b1ce53b3d8 100644 --- a/assets/app-icon/README.md +++ b/assets/app-icon/README.md @@ -17,8 +17,8 @@ Exactly three colours: ## Geometry A 512-unit tile (`viewBox="0 0 512 512"`), rounded square with `rx=112`, no border. The macOS -renders pad it onto Apple's 824/1024 icon grid; the Windows and Linux renders crop 22 units off -each side so the figure reads at 16–48 px. +renders pad it onto Apple's 824/1024 icon grid; the Windows and Linux renders use the whole tile, +as the other Crafting Apps do. ## Provenance diff --git a/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png index a28597fc9b..9f65c1fec1 100644 Binary files a/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png index ec4cb49675..02e1b9886a 100644 Binary files a/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png index 249b94787b..4b321d2bf5 100644 Binary files a/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png index db2eb42d8a..b707a2fa91 100644 Binary files a/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png index ad50ecb450..3694573349 100644 Binary files a/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png index 341185fdd8..d2ed2d865e 100644 Binary files a/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png index e54f75c920..ba0bee419e 100644 Binary files a/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png index e093144cf2..b5cbfd4fa0 100644 Binary files a/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/photocraft.ico b/assets/app-icon/photocraft.ico index 88c8a0adad..7d4d947f11 100644 Binary files a/assets/app-icon/photocraft.ico and b/assets/app-icon/photocraft.ico differ diff --git a/packaging/icons.sh b/packaging/icons.sh index dd15ae052b..d472f94eb5 100755 --- a/packaging/icons.sh +++ b/packaging/icons.sh @@ -15,13 +15,11 @@ trap 'rm -rf "$TMP"' EXIT command -v resvg >/dev/null || { echo "error: resvg not found (brew install resvg)" >&2; exit 1; } # The artwork is a full-bleed 512-unit tile (rx=112). macOS icons pad it to Apple's 824/1024 body -# grid (transparent margin). Windows and Linux icons crop 22 units off each side (into the -# rounded corners) so the portrait reads at 16-48 px. +# grid (transparent margin). Windows and Linux use the whole tile, so their corners are as round +# as the other Craft apps' (#4478). grep -q 'viewBox="0 0 512 512"' "$SVG" || { echo "error: expected viewBox=\"0 0 512 512\" in $SVG" >&2; exit 1; } MAC="$TMP/mac.svg" sed 's/viewBox="0 0 512 512"/viewBox="-62 -62 636 636"/' "$SVG" >"$MAC" -TIGHT="$TMP/tight.svg" -sed 's/viewBox="0 0 512 512"/viewBox="22 22 468 468"/' "$SVG" >"$TIGHT" render() { resvg -w "$2" -h "$2" "$1" "$3"