From 13e7b0fe0e2aa19afc609279ddbd81a8fd98b68b Mon Sep 17 00:00:00 2001 From: Hector Villarreal Date: Sun, 1 Nov 2026 01:03:54 -0600 Subject: [PATCH] Copy CSS: test a rounded rectangle's border-radius after a 2x scale (CodeRabbit review on layer_css_cmds/tests.rs:165) No test checked the copied border-radius after `shape.edit`'s `transform` scales the live radii. With radii 12 and a uniform 2x scale the rule now has to say `border-radius: 24px;`, so a regression in that scaling fails the test. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/layer_css_cmds/tests.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/engine/src/cmd/layer_css_cmds/tests.rs b/crates/engine/src/cmd/layer_css_cmds/tests.rs index ae6470efc1c..818f6057d5d 100644 --- a/crates/engine/src/cmd/layer_css_cmds/tests.rs +++ b/crates/engine/src/cmd/layer_css_cmds/tests.rs @@ -169,6 +169,11 @@ fn a_rounded_rectangle_writes_its_border_radius() { s.execute("shape.edit", json!({"layer": id, "radii": [0, 0, 0, 0]})).unwrap(); let css = s.execute(ID, json!({"layer": id})).unwrap()["css"].as_str().unwrap().to_string(); assert!(!css.contains("border-radius") && css.contains(" background-color: rgb(255, 0, 0);\n"), "{css}"); + // Scaled 2× on both axes, its corners are twice as round. + s.execute("shape.edit", json!({"layer": id, "radii": [12, 12, 12, 12]})).unwrap(); + s.execute("shape.edit", json!({"layer": id, "transform": [2, 0, 0, 2, 0, 0]})).unwrap(); + let css = s.execute(ID, json!({"layer": id})).unwrap()["css"].as_str().unwrap().to_string(); + assert!(css.contains(" border-radius: 24px;\n background-color: rgb(255, 0, 0);\n"), "{css}"); } /// A live ellipse writes `border-radius: 50%;` where a rounded rectangle writes its radii, so the