Skip to content

Commit add6244

Browse files
committed
fix: prevent built-in icons invalid size
1 parent dd4c1e4 commit add6244

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustmotion"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2021"
55
description = "A CLI tool that renders motion design videos from JSON scenarios. No browser, no Node.js — just a single Rust binary."
66
license = "MIT"

src/engine/renderer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,6 +2185,8 @@ pub(crate) fn fetch_icon_svg(icon: &str, color: &str, width: u32, height: u32) -
21852185
.split_once(':')
21862186
.ok_or_else(|| anyhow::anyhow!("Invalid icon format: '{}' (expected 'prefix:name')", icon))?;
21872187
let hex_color = color.trim_start_matches('#');
2188+
let width = width.max(1);
2189+
let height = height.max(1);
21882190
let url = format!(
21892191
"https://api.iconify.design/{}/{}.svg?color=%23{}&width={}&height={}",
21902192
prefix, name, hex_color, width, height

0 commit comments

Comments
 (0)