mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-30 12:47:13 -06:00
Panels to Illustrator parity (19 panels), ~70 menu commands, generic param dialogs, view rotation, property/model-based tests + MCP e2e; fix arrange overflow, compound grouping, double journaling, float round-trip, coordinate sanity, simplify growth, batch rollback of session state
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
213b0927ee
commit
42df20ca7f
+55
-6
@@ -24,7 +24,16 @@ pub fn icon_png(size: u32) -> Vec<u8> {
|
||||
let mut gp = grad;
|
||||
gp.angle = -45.0;
|
||||
let bg = d.alloc_id();
|
||||
d.insert(Some(l), 9, Node::path(bg, shapes::rounded_rectangle(Rect::new(100.0, 100.0, 924.0, 924.0), 185.0), Appearance::basic(Paint::Gradient(Box::new(gp)), Paint::None, 0.0))).unwrap();
|
||||
d.insert(
|
||||
Some(l),
|
||||
9,
|
||||
Node::path(
|
||||
bg,
|
||||
shapes::rounded_rectangle(Rect::new(100.0, 100.0, 924.0, 924.0), 185.0),
|
||||
Appearance::basic(Paint::Gradient(Box::new(gp)), Paint::None, 0.0),
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
// Pen nib.
|
||||
let c = Point::new(512.0, 520.0);
|
||||
let nib = PathData::single(SubPath::new(
|
||||
@@ -40,15 +49,37 @@ pub fn icon_png(size: u32) -> Vec<u8> {
|
||||
let n = d.alloc_id();
|
||||
d.insert(Some(l), 9, Node::path(n, nib, Appearance::basic(Paint::solid(Color::WHITE), Paint::None, 0.0))).unwrap();
|
||||
let hole = d.alloc_id();
|
||||
d.insert(Some(l), 9, Node::path(hole, shapes::ellipse(Rect::from_center_size(Point::new(c.x, c.y - 30.0), (74.0, 74.0))), Appearance::basic(Paint::Gradient(Box::new(GradientPaint::new(Gradient::default()))), Paint::None, 0.0))).unwrap();
|
||||
d.insert(
|
||||
Some(l),
|
||||
9,
|
||||
Node::path(
|
||||
hole,
|
||||
shapes::ellipse(Rect::from_center_size(Point::new(c.x, c.y - 30.0), (74.0, 74.0))),
|
||||
Appearance::basic(Paint::Gradient(Box::new(GradientPaint::new(Gradient::default()))), Paint::None, 0.0),
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
d.node_mut(hole).unwrap().appearance = Appearance::basic(Paint::solid(Color::from_hex("#e8573f").unwrap()), Paint::None, 0.0);
|
||||
let slit = d.alloc_id();
|
||||
d.insert(Some(l), 9, Node::path(slit, shapes::rectangle(Rect::new(c.x - 9.0, c.y + 5.0, c.x + 9.0, c.y + 245.0)), Appearance::basic(Paint::solid(Color::from_hex("#e0457a").unwrap()), Paint::None, 0.0))).unwrap();
|
||||
d.insert(
|
||||
Some(l),
|
||||
9,
|
||||
Node::path(
|
||||
slit,
|
||||
shapes::rectangle(Rect::new(c.x - 9.0, c.y + 5.0, c.x + 9.0, c.y + 245.0)),
|
||||
Appearance::basic(Paint::solid(Color::from_hex("#e0457a").unwrap()), Paint::None, 0.0),
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
Renderer::new().render_region(&d, Rect::new(0.0, 0.0, s, s), size as f64 / s, false).to_png()
|
||||
}
|
||||
|
||||
pub fn run(root: &Path) -> Result<(), String> {
|
||||
let status = Command::new(std::env::var("CARGO").unwrap_or_else(|_| "cargo".into())).current_dir(root).args(["build", "--release", "-p", "drawcraft", "-p", "drawcraft-cli"]).status().map_err(|e| e.to_string())?;
|
||||
let status = Command::new(std::env::var("CARGO").unwrap_or_else(|_| "cargo".into()))
|
||||
.current_dir(root)
|
||||
.args(["build", "--release", "-p", "drawcraft", "-p", "drawcraft-cli"])
|
||||
.status()
|
||||
.map_err(|e| e.to_string())?;
|
||||
if !status.success() {
|
||||
return Err("release build failed".into());
|
||||
}
|
||||
@@ -63,11 +94,29 @@ pub fn run(root: &Path) -> Result<(), String> {
|
||||
let iconset = root.join("dist/DrawCraft.iconset");
|
||||
let _ = std::fs::remove_dir_all(&iconset);
|
||||
std::fs::create_dir_all(&iconset).map_err(|e| e.to_string())?;
|
||||
for (sz, name) in [(16, "16x16"), (32, "16x16@2x"), (32, "32x32"), (64, "32x32@2x"), (128, "128x128"), (256, "128x128@2x"), (256, "256x256"), (512, "256x256@2x"), (512, "512x512"), (1024, "512x512@2x")] {
|
||||
for (sz, name) in [
|
||||
(16, "16x16"),
|
||||
(32, "16x16@2x"),
|
||||
(32, "32x32"),
|
||||
(64, "32x32@2x"),
|
||||
(128, "128x128"),
|
||||
(256, "128x128@2x"),
|
||||
(256, "256x256"),
|
||||
(512, "256x256@2x"),
|
||||
(512, "512x512"),
|
||||
(1024, "512x512@2x"),
|
||||
] {
|
||||
std::fs::write(iconset.join(format!("icon_{name}.png")), icon_png(sz)).map_err(|e| e.to_string())?;
|
||||
}
|
||||
std::fs::write(root.join("dist/DrawCraft-icon.png"), icon_png(1024)).map_err(|e| e.to_string())?;
|
||||
let ok = Command::new("iconutil").args(["-c", "icns"]).arg(&iconset).arg("-o").arg(app.join("Resources/DrawCraft.icns")).status().map(|s| s.success()).unwrap_or(false);
|
||||
let ok = Command::new("iconutil")
|
||||
.args(["-c", "icns"])
|
||||
.arg(&iconset)
|
||||
.arg("-o")
|
||||
.arg(app.join("Resources/DrawCraft.icns"))
|
||||
.status()
|
||||
.map(|s| s.success())
|
||||
.unwrap_or(false);
|
||||
if !ok {
|
||||
eprintln!("warning: iconutil failed or missing; bundle has no icon");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user