Merge pull request #1284 from Silvertree2010/fix/h2791-object-stroke-accepts-an-unbound

Clamp object.stroke tint and gapTint to 0..1
This commit is contained in:
Brandon Thomas
2026-10-19 02:49:24 -04:00
committed by GitHub
2 changed files with 27 additions and 2 deletions
+2 -2
View File
@@ -297,7 +297,7 @@ pub fn specs() -> Vec<CommandSpec> {
st.swatch = v.into();
}
if let Some(v) = p2.get("tint").and_then(Value::as_f64) {
st.tint = v as f32;
st.tint = v.clamp(0.0, 1.0) as f32;
}
if let Some(v) = p2.get("weight").and_then(Value::as_f64) {
st.weight = v.max(0.0);
@@ -309,7 +309,7 @@ pub fn specs() -> Vec<CommandSpec> {
st.gap_swatch = v.into();
}
if let Some(v) = p2.get("gapTint").and_then(Value::as_f64) {
st.gap_tint = v as f32;
st.gap_tint = v.clamp(0.0, 1.0) as f32;
}
if let Some(v) = p2.get("gapOverprint").and_then(Value::as_bool) {
st.gap_overprint = v;