Clamp object.stroke tint and gapTint to 0..1

Found while testing crates/engine/src/cmd/object.rs:299-313 (object.stroke: `st.tint = v as f32`, `st.gap_tint = v as f32`; the no-selection path at :273 clamps, this one doesn't)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
NetterSilver
2026-10-18 19:59:59 +00:00
co-authored by Claude Haiku 5.5
parent ecd7e5d063
commit 103d7eb3ff
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;