mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
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 <[email protected]>
This commit is contained in:
1 parent
1bdba8264d
commit
13e7b0fe0e
1 file changed
+5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user