M13.30: the ArtCraft mark in the Tools bar, About and Home; VectorCraft sibling link
- paint_logo draws docs/brand/artcraft-mark.png (the README's / getartcraft.com's ArtCraft mark) as supplied, decoded once into a mipmapped texture, instead of a drawn placeholder. - The "More ArtCraft apps" sibling and help.sibling named DrawCraft (storytold/drawcraft, which doesn't exist): it is VectorCraft (storytold/vectorcraft); provenance comments in the path crate follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
053c445465
commit
2039688245
@@ -47,7 +47,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|||||||
"Other ArtCraft Apps",
|
"Other ArtCraft Apps",
|
||||||
[],
|
[],
|
||||||
None,
|
None,
|
||||||
"{app: photocraft|drawcraft|filmcraft|lightcraft|printcraft|designcraft, kind?: page|github}",
|
"{app: photocraft|vectorcraft|filmcraft|lightcraft|printcraft|designcraft, kind?: page|github}",
|
||||||
always,
|
always,
|
||||||
sibling
|
sibling
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ pub const ISSUES: &str = "https://github.com/storytold/effectcraft/issues";
|
|||||||
/// Sibling apps of the ArtCraft family: (name, what it is, GitHub repo, app page).
|
/// Sibling apps of the ArtCraft family: (name, what it is, GitHub repo, app page).
|
||||||
pub const SIBLINGS: &[(&str, &str)] = &[
|
pub const SIBLINGS: &[(&str, &str)] = &[
|
||||||
("PhotoCraft", "photocraft"),
|
("PhotoCraft", "photocraft"),
|
||||||
("DrawCraft", "drawcraft"),
|
("VectorCraft", "vectorcraft"),
|
||||||
("FilmCraft", "filmcraft"),
|
("FilmCraft", "filmcraft"),
|
||||||
("LightCraft", "lightcraft"),
|
("LightCraft", "lightcraft"),
|
||||||
("PrintCraft", "printcraft"),
|
("PrintCraft", "printcraft"),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Curve-preserving boolean operations on filled [`BezPath`]s, built on `linesweeper`'s robust
|
//! Curve-preserving boolean operations on filled [`BezPath`]s, built on `linesweeper`'s robust
|
||||||
//! sweep-line topology (MIT OR Apache-2.0).
|
//! sweep-line topology (MIT OR Apache-2.0).
|
||||||
//!
|
//!
|
||||||
//! Adapted from DrawCraft's `vectorcraft-pathops` (`crates/pathops/src/boolean.rs`; our own code,
|
//! Adapted from VectorCraft's `vectorcraft-pathops` (`crates/pathops/src/boolean.rs`; our own code,
|
||||||
//! MIT OR Apache-2.0), reworked to take and return kurbo paths directly.
|
//! MIT OR Apache-2.0), reworked to take and return kurbo paths directly.
|
||||||
//!
|
//!
|
||||||
//! Inputs are closed implicitly (a filled open path is painted as if closed). The sweep splits
|
//! Inputs are closed implicitly (a filled open path is painted as if closed). The sweep splits
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Adapted from DrawCraft's `vectorcraft-pathops` (`crates/pathops/src/fit.rs`; our own code,
|
//! Adapted from VectorCraft's `vectorcraft-pathops` (`crates/pathops/src/fit.rs`; our own code,
|
||||||
//! MIT OR Apache-2.0).
|
//! MIT OR Apache-2.0).
|
||||||
//!
|
//!
|
||||||
//! Least-squares cubic Bézier fitting of point sequences (the classic "fit a cubic with fixed end
|
//! Least-squares cubic Bézier fitting of point sequences (the classic "fit a cubic with fixed end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//! offsetting (kurbo's stroker offsets curves analytically and refits them) and robust overlap
|
//! offsetting (kurbo's stroker offsets curves analytically and refits them) and robust overlap
|
||||||
//! removal (the boolean sweep).
|
//! removal (the boolean sweep).
|
||||||
//!
|
//!
|
||||||
//! Adapted from DrawCraft's `vectorcraft-pathops` (`crates/pathops/src/offset.rs`; our own code,
|
//! Adapted from VectorCraft's `vectorcraft-pathops` (`crates/pathops/src/offset.rs`; our own code,
|
||||||
//! MIT OR Apache-2.0).
|
//! MIT OR Apache-2.0).
|
||||||
|
|
||||||
use kurbo::{BezPath, PathEl, Stroke, StrokeOpts};
|
use kurbo::{BezPath, PathEl, Stroke, StrokeOpts};
|
||||||
|
|||||||
@@ -293,21 +293,25 @@ pub fn color_popup(ui: &mut egui::Ui, id: egui::Id, pos: egui::Pos2, c: &mut [f3
|
|||||||
changed
|
changed
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The EffectCraft mark: a rounded square with a gradient-like split and a keyframe diamond.
|
/// The ArtCraft mark as supplied in `docs/brand` (the README's and getartcraft.com's logo; used
|
||||||
|
/// unmodified, see `docs/brand/LICENSE-brand.txt`).
|
||||||
|
static ARTCRAFT_MARK: &[u8] = include_bytes!("../../../docs/brand/artcraft-mark.png");
|
||||||
|
|
||||||
|
/// The ArtCraft mark in `r` (decoded once into a mipmapped texture, so it stays crisp from the
|
||||||
|
/// 24 px Tools bar to the About dialog). Nothing is drawn if it can't be decoded.
|
||||||
pub fn paint_logo(p: &egui::Painter, r: Rect) {
|
pub fn paint_logo(p: &egui::Painter, r: Rect) {
|
||||||
p.rect_filled(r, 6.0, Color32::from_rgb(0x1d, 0x2b, 0x5e));
|
let ctx = p.ctx();
|
||||||
let inner = r.shrink(2.0);
|
let id = egui::Id::new("artcraft-mark");
|
||||||
p.rect_filled(
|
let tex = ctx.data(|d| d.get_temp::<Option<egui::TextureHandle>>(id)).unwrap_or_else(|| {
|
||||||
Rect::from_min_max(inner.min, pos2(inner.center().x, inner.max.y)),
|
let tex = image::load_from_memory_with_format(ARTCRAFT_MARK, image::ImageFormat::Png).ok().map(|img| {
|
||||||
egui::CornerRadius { nw: 5, sw: 5, ne: 0, se: 0 },
|
let img = img.to_rgba8();
|
||||||
Color32::from_rgb(0x2d, 0x8c, 0xeb),
|
let ci = egui::ColorImage::from_rgba_unmultiplied([img.width() as usize, img.height() as usize], img.as_raw());
|
||||||
);
|
ctx.load_texture("artcraft-mark", ci, egui::TextureOptions::LINEAR.with_mipmap_mode(Some(egui::TextureFilter::Linear)))
|
||||||
p.rect_filled(
|
});
|
||||||
Rect::from_min_max(pos2(inner.center().x, inner.min.y), inner.max),
|
ctx.data_mut(|d| d.insert_temp(id, tex.clone()));
|
||||||
egui::CornerRadius { nw: 0, sw: 0, ne: 5, se: 5 },
|
tex
|
||||||
Color32::from_rgb(0x8e, 0x6b, 0xff),
|
});
|
||||||
);
|
if let Some(t) = tex {
|
||||||
let c = r.center();
|
p.image(t.id(), r, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
|
||||||
let s = r.width() * 0.26;
|
}
|
||||||
p.add(egui::Shape::convex_polygon(vec![c + vec2(0.0, -s), c + vec2(s, 0.0), c + vec2(0.0, s), c + vec2(-s, 0.0)], Color32::WHITE, Stroke::NONE));
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user