Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

M13.30: the ArtCraft mark in the Tools bar, About and Home; VectorCraft sibling link

bflatastic203968824541
diff --git a/crates/engine/src/commands/help.rs b/crates/engine/src/commands/help.rs
index 0e9dd04d2..7a22f0db4 100644
--- a/crates/engine/src/commands/help.rs
+++ b/crates/engine/src/commands/help.rs
@@ -47,7 +47,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Other ArtCraft Apps",
[],
None,
- "{app: photocraft|drawcraft|filmcraft|lightcraft|printcraft|designcraft, kind?: page|github}",
+ "{app: photocraft|vectorcraft|filmcraft|lightcraft|printcraft|designcraft, kind?: page|github}",
always,
sibling
),
diff --git a/crates/engine/src/links.rs b/crates/engine/src/links.rs
index 41f8bfda4..df140ea4e 100644
--- a/crates/engine/src/links.rs
+++ b/crates/engine/src/links.rs
@@ -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).
pub const SIBLINGS: &[(&str, &str)] = &[
("PhotoCraft", "photocraft"),
- ("DrawCraft", "drawcraft"),
+ ("VectorCraft", "vectorcraft"),
("FilmCraft", "filmcraft"),
("LightCraft", "lightcraft"),
("PrintCraft", "printcraft"),
diff --git a/crates/path/src/boolean.rs b/crates/path/src/boolean.rs
index 4cdaeb29d..5a81b3e19 100644
--- a/crates/path/src/boolean.rs
+++ b/crates/path/src/boolean.rs
@@ -1,7 +1,7 @@
//! Curve-preserving boolean operations on filled [`BezPath`]s, built on `linesweeper`'s robust
//! 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.
//!
//! Inputs are closed implicitly (a filled open path is painted as if closed). The sweep splits
diff --git a/crates/path/src/fit.rs b/crates/path/src/fit.rs
index 337acc908..fdd042910 100644
--- a/crates/path/src/fit.rs
+++ b/crates/path/src/fit.rs
@@ -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).
//!
//! Least-squares cubic Bézier fitting of point sequences (the classic "fit a cubic with fixed end
diff --git a/crates/path/src/offset.rs b/crates/path/src/offset.rs
index 0bca8ca1e..c0ec49d97 100644
--- a/crates/path/src/offset.rs
+++ b/crates/path/src/offset.rs
@@ -2,7 +2,7 @@
//! offsetting (kurbo's stroker offsets curves analytically and refits them) and robust overlap
//! 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).
use kurbo::{BezPath, PathEl, Stroke, StrokeOpts};
diff --git a/crates/ui-egui/src/header.rs b/crates/ui-egui/src/header.rs
index 3e70ee60e..fdedbc079 100644
--- a/crates/ui-egui/src/header.rs
+++ b/crates/ui-egui/src/header.rs
@@ -293,21 +293,25 @@ pub fn color_popup(ui: &mut egui::Ui, id: egui::Id, pos: egui::Pos2, c: &mut [f3
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) {
- p.rect_filled(r, 6.0, Color32::from_rgb(0x1d, 0x2b, 0x5e));
- let inner = r.shrink(2.0);
- p.rect_filled(
- Rect::from_min_max(inner.min, pos2(inner.center().x, inner.max.y)),
- egui::CornerRadius { nw: 5, sw: 5, ne: 0, se: 0 },
- Color32::from_rgb(0x2d, 0x8c, 0xeb),
- );
- p.rect_filled(
- Rect::from_min_max(pos2(inner.center().x, inner.min.y), inner.max),
- egui::CornerRadius { nw: 0, sw: 0, ne: 5, se: 5 },
- Color32::from_rgb(0x8e, 0x6b, 0xff),
- );
- let c = r.center();
- 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));
+ let ctx = p.ctx();
+ let id = egui::Id::new("artcraft-mark");
+ let tex = ctx.data(|d| d.get_temp::<Option<egui::TextureHandle>>(id)).unwrap_or_else(|| {
+ let tex = image::load_from_memory_with_format(ARTCRAFT_MARK, image::ImageFormat::Png).ok().map(|img| {
+ let img = img.to_rgba8();
+ 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)))
+ });
+ ctx.data_mut(|d| d.insert_temp(id, tex.clone()));
+ tex
+ });
+ if let Some(t) = tex {
+ p.image(t.id(), r, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
+ }
}