mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-21 01:44:57 +01:00
Merge main into perf/control-bar-kind-label-cache
This commit is contained in:
commit
288a3cb82f
120 files changed
+7365
-498
No files matched your search
Generated
+15
@@ -1044,6 +1044,20 @@ name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=64b181977a0488e4d1e167bc5cc8cfededc2ed4b#64b181977a0488e4d1e167bc5cc8cfededc2ed4b"
|
||||
|
||||
[[package]]
|
||||
name = "craft-font-catalog"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=23acc704933a9a5619a5cd1cddc9bb1fb5a9b2d3#23acc704933a9a5619a5cd1cddc9bb1fb5a9b2d3"
|
||||
dependencies = [
|
||||
"harfrust 0.13.3",
|
||||
"kurbo 0.13.1",
|
||||
"skrifa 0.47.0",
|
||||
"thiserror 2.0.21",
|
||||
"unicode-bidi",
|
||||
"unicode-segmentation",
|
||||
"windows-registry",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-fonts-build"
|
||||
version = "0.1.0"
|
||||
@@ -7109,6 +7123,7 @@ dependencies = [
|
||||
name = "vectorcraft-text"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"craft-font-catalog",
|
||||
"craft-proof",
|
||||
"harfrust 0.13.3",
|
||||
"icu_segmenter",
|
||||
|
||||
@@ -154,6 +154,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
|
||||
- 2026-11-01: Document Tools, a built-in add-on (Object › Plug-ins › Document Tools), starts with Save a Timestamped Copy: a copy of the document named `<name>_YYYY-MM-DD_HH-MM` (UTC; `-2`, `-3`… when that name is taken) goes next to it, or into a folder picked for a document never saved, written as File › Save a Copy writes it, so the document keeps its path, title and modified state. Off on the web, which has no clock. A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-01: Divide into Dashes joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the selected paths, or only their direct-selected segments, are cut into separate open paths of a dash length measured along the curve, with an optional gap (left empty, or kept as pieces), each keeping the path's appearance; Fit to Corners and Ends stretches or squeezes the lengths so every run starts and ends on a dash. A dialog with Preview, one undo step, at most 100000 pieces. A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-15: Common Tangents in the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the straight lines that touch two selected convex closed paths (ellipses at any rotation and scale, or convex Bézier paths) without crossing either are added as open paths with the current stroke: external, internal or all, and the line joining the centers if asked; a path inside the other has none unless the two touch, and a message says why; a dialog with Preview, one undo step (`addon.pathtools.commonTangents`, #7845). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-18: Common Tangents also takes a point (a path of one anchor) and a convex closed path: the lines from the point that touch the path, and the line from the point to the path's center if asked; a point on the outline gets the one tangent there, and a point inside gets none, with a message (#7846). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-15: With Smart Guides and Snap to Tangent on, a Line Segment drag pressed on one convex curved path and dragged near another lands on a common tangent of the two: both ends move to where the line touches the paths, each labeled "tangent" (#7845). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), and Keep Originals adds the outline above the circles instead of replacing them. A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-03: Text Tweaker, the first tool of the Type Tools add-on (Object › Plug-ins › Type Tools): one character attribute (size, baseline shift, rotation, horizontal or vertical scale, tracking, leading or stroke weight) goes letter by letter from a start value to an end value along a straight ramp, an ease, a bow, a spike or at random with a seed, set as the Character panel sets it, while the text stays live; a dialog with Preview, one undo step (`addon.type.textTweaker`, #4924). A VectorCraft addition: headline numbers unchanged.
|
||||
|
||||
+65
-41
@@ -2106,20 +2106,39 @@ pub fn compound_part_at(n: &Node, p: Point, tol: f64) -> Option<NodeId> {
|
||||
/// the members of a group or layer with geometry effects of its own, are touched where the art those
|
||||
/// effects draw lies ([`set_drawn_art`]), as clicks hit them.
|
||||
pub fn marquee(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool) -> Vec<NodeId> {
|
||||
marquee_with(doc, r, scope, leaves, false, false)
|
||||
marquee_with(doc, r, scope, leaves, false, false, false)
|
||||
}
|
||||
|
||||
/// [`marquee`] in the view the canvas shows: with `outline` (Outline view), and below a layer
|
||||
/// whose Preview is off, a clipping path counts by its plain shapes, without its live effects, as
|
||||
/// the clicks of [`HitOptions::outline`] do.
|
||||
pub fn marquee_in_view(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, outline: bool) -> Vec<NodeId> {
|
||||
marquee_with(doc, r, scope, leaves, false, outline)
|
||||
/// the clicks of [`HitOptions::outline`] do. With `skip_guides` (Lock Guides is on or the guides
|
||||
/// are hidden, as [`HitOptions::skip_guides`]), the paths made into guides are not touched, at the
|
||||
/// top or inside a group, so a group is not taken for a guide in it (#8538).
|
||||
pub fn marquee_in_view(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, outline: bool, skip_guides: bool) -> Vec<NodeId> {
|
||||
marquee_with(doc, r, scope, leaves, false, outline, skip_guides)
|
||||
}
|
||||
|
||||
/// Candidates for whole-object enclosure by a loop bounded by `r`. Eligibility and group
|
||||
/// traversal follow [`marquee_in_view`]; compounds contribute the complete path they paint.
|
||||
pub fn enclosure_candidates(doc: &Document, r: Rect, scope: Option<NodeId>, outline: bool) -> Vec<NodeId> {
|
||||
marquee_with(doc, r, scope, true, true, outline)
|
||||
pub fn enclosure_candidates(doc: &Document, r: Rect, scope: Option<NodeId>, outline: bool, skip_guides: bool) -> Vec<NodeId> {
|
||||
marquee_with(doc, r, scope, true, true, outline, skip_guides)
|
||||
}
|
||||
|
||||
/// What a marquee ([`marquee_with`]) takes, besides where it is: whether a compound path is
|
||||
/// touched by every path it paints (`whole_compounds`, for an enclosing loop's candidates), and
|
||||
/// whether the paths made into guides are left out (`skip_guides`: Lock Guides is on or the
|
||||
/// guides are hidden, [`HitOptions::skip_guides`] for the marquee).
|
||||
#[derive(Clone, Copy)]
|
||||
struct Rules {
|
||||
whole_compounds: bool,
|
||||
skip_guides: bool,
|
||||
}
|
||||
|
||||
impl Rules {
|
||||
/// Is `n` a path made into a guide that the marquee leaves out?
|
||||
fn skips(self, n: &Node) -> bool {
|
||||
self.skip_guides && matches!(n.kind, NodeKind::Path { guide: true, .. })
|
||||
}
|
||||
}
|
||||
|
||||
/// Is `n` a layer whose Preview is off (its art is drawn and clicked in outline)?
|
||||
@@ -2127,8 +2146,17 @@ fn previews_off(n: &Node) -> bool {
|
||||
matches!(n.kind, NodeKind::Layer { preview: false, .. })
|
||||
}
|
||||
|
||||
fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, whole_compounds: bool, outline: bool) -> Vec<NodeId> {
|
||||
fn marquee_with(
|
||||
doc: &Document,
|
||||
r: Rect,
|
||||
scope: Option<NodeId>,
|
||||
leaves: bool,
|
||||
whole_compounds: bool,
|
||||
outline: bool,
|
||||
skip_guides: bool,
|
||||
) -> Vec<NodeId> {
|
||||
let _walk = ArtWalk::open();
|
||||
let rules = Rules { whole_compounds, skip_guides };
|
||||
let mut out = Vec::new();
|
||||
// The locks first: they copy the kept art boxes that `symbols` takes, and `symbols` keeps theirs.
|
||||
let locks = doc.locked_artboards_kept();
|
||||
@@ -2142,7 +2170,7 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
Some(c) => {
|
||||
// In an isolated clip group, its members by their own geometry, as clicks take
|
||||
// them ([`edits_inside`]).
|
||||
let drawn = if s.clips() { None } else { touched_in_art(s, &symbols, r, whole_compounds, outline || previews_off(s)) };
|
||||
let drawn = if s.clips() { None } else { touched_in_art(s, &symbols, r, rules, outline || previews_off(s)) };
|
||||
c.iter()
|
||||
.enumerate()
|
||||
.filter(|(i, c)| !c.is_ruler_guide() && !shaper_hides(s, *i, scope))
|
||||
@@ -2164,7 +2192,7 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
.layers
|
||||
.iter()
|
||||
.filter(|l| l.visible && !l.locked && !l.is_template() && doc.pattern_edit.as_ref().is_none_or(|e| e.layer == l.id))
|
||||
.flat_map(|l| layer_objects(l, &symbols, r, outline, whole_compounds, None))
|
||||
.flat_map(|l| layer_objects(l, &symbols, r, outline, rules, None))
|
||||
.collect(),
|
||||
};
|
||||
/// The objects of layer `l`, each with the part of `r` that the clipping masks of `l` and of
|
||||
@@ -2173,17 +2201,10 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
/// shapes ([`mask_marquee`]). In a layer whose own geometry effects reshape its art, each object
|
||||
/// comes with the objects that art touches ([`touched_in_art`]), `drawn` when a layer around
|
||||
/// `l` has such effects.
|
||||
fn layer_objects<'a>(
|
||||
l: &'a Node,
|
||||
s: &SymbolBoxes,
|
||||
r: Rect,
|
||||
outline: bool,
|
||||
whole_compounds: bool,
|
||||
drawn: Option<Rc<HashSet<NodeId>>>,
|
||||
) -> Vec<Top<'a>> {
|
||||
fn layer_objects<'a>(l: &'a Node, s: &SymbolBoxes, r: Rect, outline: bool, rules: Rules, drawn: Option<Rc<HashSet<NodeId>>>) -> Vec<Top<'a>> {
|
||||
let mut out = vec![];
|
||||
let outline = outline || previews_off(l);
|
||||
let drawn = drawn.or_else(|| touched_in_art(l, s, r, whole_compounds, outline));
|
||||
let drawn = drawn.or_else(|| touched_in_art(l, s, r, rules, outline));
|
||||
let inner = marquee_in_parent(l, r, outline);
|
||||
for (i, c) in l.children().into_iter().flatten().enumerate() {
|
||||
if c.is_layer() {
|
||||
@@ -2192,7 +2213,7 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
&& !c.locked
|
||||
&& !c.is_template()
|
||||
{
|
||||
out.extend(layer_objects(c, s, inner, outline, whole_compounds, drawn.clone()));
|
||||
out.extend(layer_objects(c, s, inner, outline, rules, drawn.clone()));
|
||||
}
|
||||
} else if !c.is_ruler_guide() {
|
||||
if drawn.is_some() {
|
||||
@@ -2209,12 +2230,12 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
/// The ids of the objects of the art that group or layer `n` draws with its own geometry
|
||||
/// effects ([`drawn_art`]) that the marquee `r` touches, as [`collect_leaves`] collects them.
|
||||
/// `None` in outline and when it has no such effects.
|
||||
fn touched_in_art(n: &Node, s: &SymbolBoxes, r: Rect, whole_compounds: bool, outline: bool) -> Option<Rc<HashSet<NodeId>>> {
|
||||
fn touched_in_art(n: &Node, s: &SymbolBoxes, r: Rect, rules: Rules, outline: bool) -> Option<Rc<HashSet<NodeId>>> {
|
||||
let art = drawn_art(s, n, outline)?;
|
||||
let _off = DrawnOff::set();
|
||||
let mut ids = vec![];
|
||||
for a in art.iter().filter(|a| a.visible) {
|
||||
collect_leaves(a, s, r, None, whole_compounds, false, &mut ids);
|
||||
collect_leaves(a, s, r, None, rules, false, &mut ids);
|
||||
}
|
||||
Some(Rc::new(ids.into_iter().collect()))
|
||||
}
|
||||
@@ -2271,12 +2292,16 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
/// instance also where its fills and strokes paint outside it ([`painted_touches`]). A clipping
|
||||
/// path is touched by its own geometry ([`mask_marquee`]) and on the edge of its region
|
||||
/// ([`clip_edge_touches`]).
|
||||
fn touches(n: &Node, s: &SymbolBoxes, r: Rect, scope: Option<NodeId>, whole_compounds: bool, outline: bool) -> bool {
|
||||
fn touches(n: &Node, s: &SymbolBoxes, r: Rect, scope: Option<NodeId>, rules: Rules, outline: bool) -> bool {
|
||||
// Locked or hidden guides are not touched ([`Rules::skips`]).
|
||||
if rules.skips(n) {
|
||||
return false;
|
||||
}
|
||||
// A path or compound path whose geometry effects reshape it, or a group or layer whose own
|
||||
// geometry effects reshape its members, is touched where that art is drawn ([`drawn_art`]).
|
||||
if let Some(art) = drawn_art(s, n, outline || previews_off(n)) {
|
||||
let _off = DrawnOff::set();
|
||||
return art.iter().any(|a| a.visible && touches(a, s, r, None, whole_compounds, false));
|
||||
return art.iter().any(|a| a.visible && touches(a, s, r, None, rules, false));
|
||||
}
|
||||
match &n.kind {
|
||||
NodeKind::Path { path, .. } => vectorcraft_geom::hit::intersects_rect(path, r),
|
||||
@@ -2287,25 +2312,26 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
c.visible
|
||||
&& !shaper_hides(n, i, scope)
|
||||
&& if i == 0 && n.clips() {
|
||||
plain(true, || mask_marquee(n, r).is_some_and(|r| touches(c, s, r, scope, whole_compounds, outline)))
|
||||
plain(true, || mask_marquee(n, r).is_some_and(|r| touches(c, s, r, scope, rules, outline)))
|
||||
|| clip_edge_touches(c, r, outline)
|
||||
} else {
|
||||
inner.is_some_and(|r| touches(c, s, r, scope, whole_compounds, outline))
|
||||
inner.is_some_and(|r| touches(c, s, r, scope, rules, outline))
|
||||
}
|
||||
})
|
||||
}
|
||||
NodeKind::Compound { children, .. } if whole_compounds => {
|
||||
children.iter().filter_map(|c| c.path_data()).any(|path| vectorcraft_geom::hit::intersects_rect(path, r))
|
||||
NodeKind::Compound { children, .. } if rules.whole_compounds => {
|
||||
// Guide contours left out ([`Rules::skips`]) don't make the compound a candidate.
|
||||
children.iter().filter(|c| !rules.skips(c)).filter_map(|c| c.path_data()).any(|path| vectorcraft_geom::hit::intersects_rect(path, r))
|
||||
}
|
||||
NodeKind::Compound { children, .. } => children.iter().any(|c| c.visible && touches(c, s, r, scope, whole_compounds, outline)),
|
||||
NodeKind::Repeat(spec) => spec.expand(Some(s.document())).iter().any(|copy| touches(copy, s, r, scope, whole_compounds, outline)),
|
||||
NodeKind::Compound { children, .. } => children.iter().any(|c| c.visible && touches(c, s, r, scope, rules, outline)),
|
||||
NodeKind::Repeat(spec) => spec.expand(Some(s.document())).iter().any(|copy| touches(copy, s, r, scope, rules, outline)),
|
||||
// A symbol instance is touched by its box, and outside it where the live geometry
|
||||
// effects of a clipping path in its art show the art, or where the geometry effects of
|
||||
// its active fill or stroke reshape the art ([`painted_touches`]). In the art of another
|
||||
// instance walked outside that instance's box, it is touched only by its own art
|
||||
// ([`ArtOnly`]) and those shapes.
|
||||
NodeKind::SymbolInstance { .. } => {
|
||||
!ArtOnly::on() && box_touches(n, s, r) || !outline && (instance_art_touches(n, s, r, whole_compounds) || painted_touches(n, s, r))
|
||||
!ArtOnly::on() && box_touches(n, s, r) || !outline && (instance_art_touches(n, s, r, rules) || painted_touches(n, s, r))
|
||||
}
|
||||
// An image is touched by its box, and outside it where its own fills and strokes paint.
|
||||
NodeKind::Image(_) => box_touches(n, s, r) || !outline && painted_touches(n, s, r),
|
||||
@@ -2334,7 +2360,7 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
/// ([`SymbolBoxes::art`]), or for any art while [`ArtOnly`] is on, and only when `r` meets the
|
||||
/// instance's reach ([`Node::reach_bounds_with`]): elsewhere the art lies within the instance's
|
||||
/// box. Not once the marquee has placed as many objects of symbol art as [`ArtWalk`] allows.
|
||||
fn instance_art_touches(n: &Node, s: &SymbolBoxes, r: Rect, whole_compounds: bool) -> bool {
|
||||
fn instance_art_touches(n: &Node, s: &SymbolBoxes, r: Rect, rules: Rules) -> bool {
|
||||
let NodeKind::SymbolInstance { symbol, .. } = &n.kind else { return false };
|
||||
let meets = |b: Rect| b.x0 <= r.x1 && r.x0 <= b.x1 && b.y0 <= r.y1 && r.y0 <= b.y1;
|
||||
if s.art(symbol).is_none_or(|a| a.reshaped.is_none() && !ArtOnly::on()) || !n.reach_bounds_with(s).is_some_and(meets) {
|
||||
@@ -2351,15 +2377,15 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
#[cfg(test)]
|
||||
ARTS_WALKED.with(|c| c.set(c.get() + 1));
|
||||
let _art_only = ArtOnly::set();
|
||||
art.place(&art.art, None).is_some_and(|placed| placed.visible && touches(&placed, s, r, None, whole_compounds, false))
|
||||
art.place(&art.art, None).is_some_and(|placed| placed.visible && touches(&placed, s, r, None, rules, false))
|
||||
}
|
||||
fn collect_leaves(n: &Node, s: &SymbolBoxes, r: Rect, scope: Option<NodeId>, whole_compounds: bool, outline: bool, out: &mut Vec<NodeId>) {
|
||||
fn collect_leaves(n: &Node, s: &SymbolBoxes, r: Rect, scope: Option<NodeId>, rules: Rules, outline: bool, out: &mut Vec<NodeId>) {
|
||||
match &n.kind {
|
||||
NodeKind::Layer { children, .. } | NodeKind::Group { children, .. } | NodeKind::Intertwine { children } => {
|
||||
let outline = outline || previews_off(n);
|
||||
// The members that the art its own geometry effects draw touches, and a group whose
|
||||
// own fills and strokes that art paints, as clicks hit it ([`member_chain`]).
|
||||
if let Some(drawn) = touched_in_art(n, s, r, whole_compounds, outline) {
|
||||
if let Some(drawn) = touched_in_art(n, s, r, rules, outline) {
|
||||
if drawn.contains(&n.id) && !n.is_layer() {
|
||||
out.push(n.id);
|
||||
}
|
||||
@@ -2374,18 +2400,18 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
if i == 0 && n.clips() {
|
||||
let before = out.len();
|
||||
if let Some(r) = mask_marquee(n, r) {
|
||||
plain(true, || collect_leaves(c, s, r, scope, whole_compounds, outline, out));
|
||||
plain(true, || collect_leaves(c, s, r, scope, rules, outline, out));
|
||||
}
|
||||
if out.len() == before && is_leaf(c) && clip_edge_touches(c, r, outline) {
|
||||
out.push(c.id);
|
||||
}
|
||||
} else if let Some(r) = inner {
|
||||
collect_leaves(c, s, r, scope, whole_compounds, outline, out);
|
||||
collect_leaves(c, s, r, scope, rules, outline, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if touches(n, s, r, scope, whole_compounds, outline) {
|
||||
if touches(n, s, r, scope, rules, outline) {
|
||||
out.push(n.id);
|
||||
}
|
||||
}
|
||||
@@ -2420,14 +2446,12 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option<NodeId>, leaves: bool, wh
|
||||
if leaves {
|
||||
let before = out.len();
|
||||
if let Some(r) = r {
|
||||
collect_leaves(t, &symbols, r, scope, whole_compounds, outline, &mut out);
|
||||
collect_leaves(t, &symbols, r, scope, rules, outline, &mut out);
|
||||
}
|
||||
if edge.is_some_and(|e| out.len() == before && is_leaf(t) && clip_edge_touches(t, e, outline)) {
|
||||
out.push(t.id);
|
||||
}
|
||||
} else if r.is_some_and(|r| touches(t, &symbols, r, scope, whole_compounds, outline))
|
||||
|| edge.is_some_and(|e| clip_edge_touches(t, e, outline))
|
||||
{
|
||||
} else if r.is_some_and(|r| touches(t, &symbols, r, scope, rules, outline)) || edge.is_some_and(|e| clip_edge_touches(t, e, outline)) {
|
||||
out.push(t.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ fn clicks_in_a_clip_group_evaluate_its_clipping_paths_region_once_until_it_chang
|
||||
// So with a marquee across the art's left edge: in the view, only in Outline view. The
|
||||
// clipping path's own left edge lies there too, and counts in both.
|
||||
let edge = Rect::new(-5.0, 40.0, 5.0, 60.0);
|
||||
assert_eq!(marquee_in_view(&d, edge, None, true, false), [mask_id]);
|
||||
assert_eq!(marquee_in_view(&d, edge, None, true, true), [mask_id, art_id]);
|
||||
assert_eq!(marquee_in_view(&d, edge, None, true, false, false), [mask_id]);
|
||||
assert_eq!(marquee_in_view(&d, edge, None, true, true, false), [mask_id, art_id]);
|
||||
// `marquee_in` measures by the plain shapes, as its callers clip by them.
|
||||
assert!(marquee_in(d.node(g).unwrap(), edge).is_some());
|
||||
// Hidden, the effect no longer moves the region.
|
||||
@@ -489,8 +489,8 @@ fn a_marquee_touches_a_paths_shifted_art_not_its_source() {
|
||||
for leaves in [false, true] {
|
||||
assert_eq!(marquee(&d, drawn, None, leaves), [a], "where it is drawn");
|
||||
assert!(marquee(&d, own, None, leaves).is_empty(), "its own place");
|
||||
assert!(marquee_in_view(&d, drawn, None, leaves, true).is_empty(), "outline: no drawn art");
|
||||
assert_eq!(marquee_in_view(&d, own, None, leaves, true), [a], "outline: its own place");
|
||||
assert!(marquee_in_view(&d, drawn, None, leaves, true, false).is_empty(), "outline: no drawn art");
|
||||
assert_eq!(marquee_in_view(&d, own, None, leaves, true, false), [a], "outline: its own place");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -870,6 +870,68 @@ fn a_selected_guide_hidden_by_a_mask_counts_only_while_guides_can_be_clicked() {
|
||||
assert_eq!(selected_hidden_at(&d, hidden, HitOptions { skip_guides: true, ..opt }, &[guide_id]), None);
|
||||
}
|
||||
|
||||
/// #8538: while guides are locked or hidden (`skip_guides`), a marquee touches no guide path, at
|
||||
/// the top of a layer or in a group (the group is not taken for it), nor in a group in a group,
|
||||
/// with leaves or without. The group's other members still take it, and with the guides unlocked
|
||||
/// the guide does.
|
||||
#[test]
|
||||
fn a_marquee_skips_guide_paths_in_groups_while_guides_are_locked() {
|
||||
let mut d = Document::new(300.0, 200.0);
|
||||
let l = d.layers[0].id;
|
||||
let guide = |d: &mut Document, r: Rect| {
|
||||
let mut n = Node::path(d.alloc_id(), shapes::rectangle(r), Appearance::default_art());
|
||||
if let NodeKind::Path { guide, .. } = &mut n.kind {
|
||||
*guide = true;
|
||||
}
|
||||
n
|
||||
};
|
||||
let top = guide(&mut d, Rect::new(0.0, 0.0, 20.0, 20.0));
|
||||
let inner = guide(&mut d, Rect::new(100.0, 0.0, 120.0, 20.0));
|
||||
let art = Node::path(d.alloc_id(), shapes::rectangle(Rect::new(200.0, 0.0, 220.0, 20.0)), Appearance::default_art());
|
||||
let (top_id, inner_id, art_id) = (top.id, inner.id, art.id);
|
||||
let (outer_id, nested_id) = (d.alloc_id(), d.alloc_id());
|
||||
let nested = Node::group(nested_id, vec![Arc::new(inner)]);
|
||||
d.insert(Some(l), 0, top).unwrap();
|
||||
d.insert(Some(l), 1, Node::group(outer_id, vec![Arc::new(nested), Arc::new(art)])).unwrap();
|
||||
let (on_top, on_inner, on_art) = (Rect::new(-5.0, 5.0, 5.0, 10.0), Rect::new(95.0, 5.0, 105.0, 10.0), Rect::new(195.0, 5.0, 205.0, 10.0));
|
||||
for leaves in [false, true] {
|
||||
let m = |r: Rect, skip: bool| marquee_in_view(&d, r, None, leaves, false, skip);
|
||||
assert!(m(on_top, true).is_empty(), "a guide at the top, leaves {leaves}");
|
||||
assert!(m(on_inner, true).is_empty(), "a guide in a group in a group, leaves {leaves}");
|
||||
assert!(m(Rect::new(0.0, 0.0, 300.0, 200.0), true).iter().all(|id| ![top_id, inner_id].contains(id)), "all, leaves {leaves}");
|
||||
assert_eq!(m(on_art, true), [if leaves { art_id } else { outer_id }], "the group's art, leaves {leaves}");
|
||||
// Unlocked: the guides are touched.
|
||||
assert_eq!(m(on_top, false), [top_id], "unlocked, leaves {leaves}");
|
||||
assert_eq!(m(on_inner, false), [if leaves { inner_id } else { outer_id }], "unlocked, leaves {leaves}");
|
||||
}
|
||||
// An enclosing loop's candidates leave them out alike.
|
||||
assert!(enclosure_candidates(&d, on_inner, None, false, true).is_empty());
|
||||
assert_eq!(enclosure_candidates(&d, on_inner, None, false, false), [inner_id]);
|
||||
}
|
||||
|
||||
/// #8538: an enclosing loop's candidates leave out a compound path whose touched contours are all
|
||||
/// locked or hidden guides, as the marquee does.
|
||||
#[test]
|
||||
fn guide_contours_do_not_make_a_compound_an_enclosure_candidate() {
|
||||
let mut d = Document::new(300.0, 200.0);
|
||||
let l = d.layers[0].id;
|
||||
let part = |d: &mut Document, r: Rect| {
|
||||
let mut n = Node::path(d.alloc_id(), shapes::rectangle(r), Appearance::default_art());
|
||||
if let NodeKind::Path { guide, .. } = &mut n.kind {
|
||||
*guide = true;
|
||||
}
|
||||
Arc::new(n)
|
||||
};
|
||||
let (a, b) = (part(&mut d, Rect::new(10.0, 10.0, 50.0, 50.0)), part(&mut d, Rect::new(20.0, 20.0, 40.0, 40.0)));
|
||||
let id = d.alloc_id();
|
||||
let mut compound = Node::group(id, vec![]);
|
||||
compound.kind = NodeKind::Compound { children: vec![a, b], rule: Default::default() };
|
||||
d.insert(Some(l), 0, compound).unwrap();
|
||||
let r = Rect::new(0.0, 0.0, 60.0, 60.0);
|
||||
assert!(enclosure_candidates(&d, r, None, false, true).is_empty(), "locked or hidden");
|
||||
assert_eq!(enclosure_candidates(&d, r, None, false, false), [id], "shown and unlocked");
|
||||
}
|
||||
|
||||
/// A selected path in a Shaper group's original shapes, where an outer mask hides it, counts only
|
||||
/// while those shapes can be clicked (Construction mode, with them isolated), however deep it
|
||||
/// lies in them.
|
||||
@@ -2674,7 +2736,7 @@ fn a_symbol_instance_is_hit_where_a_moved_clipping_path_in_its_art_shows_the_art
|
||||
assert_eq!(marquee(&d, edge, None, false), [g], "layer {layer}");
|
||||
assert_eq!(marquee(&d, edge, None, true), [inst], "layer {layer}");
|
||||
assert!(marquee(&d, past, None, false).is_empty());
|
||||
assert!(marquee_in_view(&d, edge, None, false, true).is_empty(), "Outline view");
|
||||
assert!(marquee_in_view(&d, edge, None, false, true, false).is_empty(), "Outline view");
|
||||
}
|
||||
// Preview off for the layer the instance is on.
|
||||
let (mut d, _, _) = build("test.move", Affine::IDENTITY, false, true, false);
|
||||
|
||||
@@ -90,6 +90,42 @@ impl Node {
|
||||
matches!(self.kind, NodeKind::RulerGuide { .. } | NodeKind::Path { guide: true, .. })
|
||||
}
|
||||
|
||||
/// This object without the paths made into guides among the members of its groups, layers,
|
||||
/// Intertwine groups and compound paths, at any depth, for measuring the art around them while
|
||||
/// Lock Guides or Hide Guides leaves them out (#8538). The clipping path of a clip group or
|
||||
/// layer and the original shapes of a Shaper group stay, guides or not, so the object keeps
|
||||
/// its structure. `None` when it holds no such guide.
|
||||
pub fn without_guides(&self) -> Option<Node> {
|
||||
let (NodeKind::Layer { children, .. }
|
||||
| NodeKind::Group { children, .. }
|
||||
| NodeKind::Intertwine { children }
|
||||
| NodeKind::Compound { children, .. }) = &self.kind
|
||||
else {
|
||||
return None;
|
||||
};
|
||||
let keep = usize::from(self.clips() || self.extras().shaper.is_some());
|
||||
let mut changed = false;
|
||||
let mut out = Vec::with_capacity(children.len());
|
||||
for (i, c) in children.iter().enumerate() {
|
||||
if i >= keep && matches!(c.kind, NodeKind::Path { guide: true, .. }) {
|
||||
changed = true;
|
||||
} else if let Some(stripped) = c.without_guides() {
|
||||
changed = true;
|
||||
out.push(Arc::new(stripped));
|
||||
} else {
|
||||
out.push(c.clone());
|
||||
}
|
||||
}
|
||||
if !changed {
|
||||
return None;
|
||||
}
|
||||
let mut n = self.clone();
|
||||
if let Some(c) = n.children_mut() {
|
||||
*c = out;
|
||||
}
|
||||
Some(n)
|
||||
}
|
||||
|
||||
/// A template layer (Layer Options → Template).
|
||||
pub fn is_template(&self) -> bool {
|
||||
matches!(self.kind, NodeKind::Layer { template: true, .. })
|
||||
|
||||
@@ -312,6 +312,36 @@ impl Carry {
|
||||
}
|
||||
}
|
||||
|
||||
/// Undo the actual maps of already placed gradients. Failure only changes this temporary
|
||||
/// appearance; callers retain the stored row unchanged when a map cannot be inverted.
|
||||
pub(crate) fn unapply_placed(&self, ap: &mut Appearance) -> Option<()> {
|
||||
for step in self.0.iter().rev() {
|
||||
for item in &mut ap.items {
|
||||
if !matches!(item.paint(), vectorcraft_doc::color::Paint::Gradient(_)) {
|
||||
continue;
|
||||
}
|
||||
let map = match *step {
|
||||
CarryStep::Affine { m, .. } => m,
|
||||
CarryStep::Boxes { from, to } => match item {
|
||||
AppearanceItem::Fill(_) => crate::reshape::box_map(from, to),
|
||||
AppearanceItem::Stroke(s) => crate::reshape::box_map(s.paint_bounds(from), s.paint_bounds(to)),
|
||||
},
|
||||
};
|
||||
if vectorcraft_doc::node::flattens(map) {
|
||||
return None;
|
||||
}
|
||||
let inverse = map.inverse();
|
||||
if !inverse.is_finite() {
|
||||
return None;
|
||||
}
|
||||
if let vectorcraft_doc::color::Paint::Gradient(g) = item.paint_mut() {
|
||||
g.transform(inverse);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(())
|
||||
}
|
||||
|
||||
pub(crate) fn push(&mut self, more: Carry) {
|
||||
self.0.extend(more.0);
|
||||
self.1.extend(more.1);
|
||||
|
||||
+79
-25
@@ -846,23 +846,19 @@ fn take_sublayer_guides(n: &mut Node, out: &mut Vec<Arc<Node>>, is_guide: &impl
|
||||
take_held_guides(n, held, out, false, false);
|
||||
}
|
||||
|
||||
/// `n`, a group or layer, as plain art: its Pathfinder effects evaluated, its geometry effects
|
||||
/// reshaping all its members as one piece (the whole art's bounds as their reference box) after
|
||||
/// the members' own geometry and Pathfinder effects ([`members_as_drawn`]), and its
|
||||
/// own fills and strokes turned into art painting the members' geometry ([`member_shapes`]) below
|
||||
/// the members (after a clipping path) or above them, as its contents slot says. Its
|
||||
/// transparency, opacity mask and raster effects stay. `None` when it has none of these. Live
|
||||
/// objects among the members are evaluated with the symbols of `doc` (see [`member_shapes`]), and
|
||||
/// a Pathfinder operation or compound shape takes the symbol instances among its members as their
|
||||
/// symbols' art from `doc`. A Transform effect that makes copies with raster effects listed before
|
||||
/// it gives each copy those raster effects ([`copied_container`]).
|
||||
pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
|
||||
struct PreparedContainer {
|
||||
m: Node,
|
||||
guides: Vec<Arc<Node>>,
|
||||
paint: bool,
|
||||
carry: crate::Carry,
|
||||
}
|
||||
|
||||
/// The existing container pass up to its own rows becoming art. Keep its carried appearance for
|
||||
/// rendering, and retain the same Carry for freezing only missing stored placements separately.
|
||||
fn prepare_container(doc: Option<&Document>, n: &Node) -> Option<PreparedContainer> {
|
||||
if !is_container(n) {
|
||||
return None;
|
||||
}
|
||||
if let Some(t) = crate::reshape::copied_container_raster_at(n) {
|
||||
return Some(copied_container(doc, n, t));
|
||||
}
|
||||
let pathfinder = has_pathfinder(n);
|
||||
let fx = crate::reshape::geometry_effects(n);
|
||||
let paint = has_own_paint(n);
|
||||
@@ -870,6 +866,7 @@ pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
|
||||
return None;
|
||||
}
|
||||
let mut m = n.clone();
|
||||
let mut carry = crate::Carry::default();
|
||||
// Its ruler guides take no part: they go back above the evaluated art at the end. With effects
|
||||
// that replace or copy the art, so do its guides among the art and those in its sublayers and
|
||||
// groups, which would otherwise go with that art: they stay on `n`, in order, hidden and
|
||||
@@ -896,7 +893,7 @@ pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
|
||||
let _later = crate::raster::LaterGroups::enter(&n.appearance.effects);
|
||||
members_as_drawn(doc, &mut m);
|
||||
}
|
||||
let carry = crate::reshape::reshape_leaves_carrying(&mut m, &fx, &n.appearance.effects, doc);
|
||||
carry = crate::reshape::reshape_leaves_carrying(&mut m, &fx, &n.appearance.effects, doc);
|
||||
// The group's own fills and strokes paint the members as a whole: their gradients follow
|
||||
// the effects as the members' do.
|
||||
if paint && carry.moves(&m.appearance) {
|
||||
@@ -905,6 +902,27 @@ pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
|
||||
}
|
||||
m.appearance.effects = crate::raster::without_geometry(&m.appearance.effects);
|
||||
m.appearance.effects.retain(|e| !is_pathfinder(&e.id));
|
||||
Some(PreparedContainer { m, guides, paint, carry })
|
||||
}
|
||||
|
||||
/// `n`, a group or layer, as plain art: its Pathfinder effects evaluated, its geometry effects
|
||||
/// reshaping all its members as one piece (the whole art's bounds as their reference box) after
|
||||
/// the members' own geometry and Pathfinder effects ([`members_as_drawn`]), and its
|
||||
/// own fills and strokes turned into art painting the members' geometry ([`member_shapes`]) below
|
||||
/// the members (after a clipping path) or above them, as its contents slot says. Its
|
||||
/// transparency, opacity mask and raster effects stay. `None` when it has none of these. Live
|
||||
/// objects among the members are evaluated with the symbols of `doc` (see [`member_shapes`]), and
|
||||
/// a Pathfinder operation or compound shape takes the symbol instances among its members as their
|
||||
/// symbols' art from `doc`. A Transform effect that makes copies with raster effects listed before
|
||||
/// it gives each copy those raster effects ([`copied_container`]).
|
||||
pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
|
||||
if !is_container(n) {
|
||||
return None;
|
||||
}
|
||||
if let Some(t) = crate::reshape::copied_container_raster_at(n) {
|
||||
return Some(copied_container(doc, n, t));
|
||||
}
|
||||
let PreparedContainer { mut m, guides, paint, .. } = prepare_container(doc, n)?;
|
||||
if paint {
|
||||
// A clip group whose clipping type paints strokes is now a group of a clip group and those
|
||||
// strokes ([`crate::reshape::paint_type_clip`]): its own fills and strokes paint inside
|
||||
@@ -931,16 +949,8 @@ pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
|
||||
Some(m)
|
||||
}
|
||||
|
||||
/// `n`, a group or layer whose own effects split at `t` ([`crate::reshape::copied_container_raster_at`]),
|
||||
/// as plain art: the effects before the Transform effect at `t` evaluated on its members as one
|
||||
/// piece ([`evaluate_container`]), with the raster effects among them, and that piece copied by the
|
||||
/// Transform effect, each copy a group of its own carrying those raster effects moved, turned,
|
||||
/// reflected and scaled with it ([`crate::reshape::copied_container_art`]). The art keeps the kind,
|
||||
/// transparency and opacity mask of `n` and the raster effects from `t` on, which paint once around
|
||||
/// all the copies; a clip group's or clipping layer's copies each clip, and the art itself does not.
|
||||
/// Its ruler guides, those in its sublayers and groups included, go once above the copies, hidden
|
||||
/// and locked as their containers were.
|
||||
fn copied_container(doc: Option<&Document>, n: &Node, t: usize) -> Node {
|
||||
/// The exact pre-copy source shared by rendering and stored gradient placement.
|
||||
fn copied_container_source(doc: Option<&Document>, n: &Node, t: usize) -> (Node, Vec<Arc<Node>>, Node) {
|
||||
let mut m = n.clone();
|
||||
let mut guides = vec![];
|
||||
take_sublayer_guides(&mut m, &mut guides, &Node::is_ruler_guide);
|
||||
@@ -955,6 +965,20 @@ fn copied_container(doc: Option<&Document>, n: &Node, t: usize) -> Node {
|
||||
let _later = crate::raster::LaterGroups::enter(&n.appearance.effects);
|
||||
members_as_drawn(doc, &mut source);
|
||||
}
|
||||
(m, guides, source)
|
||||
}
|
||||
|
||||
/// `n`, a group or layer whose own effects split at `t` ([`crate::reshape::copied_container_raster_at`]),
|
||||
/// as plain art: the effects before the Transform effect at `t` evaluated on its members as one
|
||||
/// piece ([`evaluate_container`]), with the raster effects among them, and that piece copied by the
|
||||
/// Transform effect, each copy a group of its own carrying those raster effects moved, turned,
|
||||
/// reflected and scaled with it ([`crate::reshape::copied_container_art`]). The art keeps the kind,
|
||||
/// transparency and opacity mask of `n` and the raster effects from `t` on, which paint once around
|
||||
/// all the copies; a clip group's or clipping layer's copies each clip, and the art itself does not.
|
||||
/// Its ruler guides, those in its sublayers and groups included, go once above the copies, hidden
|
||||
/// and locked as their containers were.
|
||||
fn copied_container(doc: Option<&Document>, n: &Node, t: usize) -> Node {
|
||||
let (mut m, guides, source) = copied_container_source(doc, n, t);
|
||||
let mut piece = evaluate_container(doc, &source).unwrap_or_else(|| {
|
||||
let mut p = source.clone();
|
||||
p.appearance.effects = crate::raster::without_geometry(&p.appearance.effects);
|
||||
@@ -988,6 +1012,36 @@ fn copied_container(doc: Option<&Document>, n: &Node, t: usize) -> Node {
|
||||
m
|
||||
}
|
||||
|
||||
/// Freeze representable fitted own paints to the box the container pass gives them, retaining
|
||||
/// every live effect and already explicit placement. Hidden-only containers the pass does not
|
||||
/// evaluate stay unchanged; this does not add a different fallback to `evaluate_container`.
|
||||
pub fn pinned_container_appearance(doc: &Document, n: &Node) -> Option<Appearance> {
|
||||
if !n.appearance.has_unplaced_gradient() {
|
||||
return None;
|
||||
}
|
||||
if let Some(t) = crate::reshape::copied_container_raster_at(n) {
|
||||
let (_, _, source) = copied_container_source(Some(doc), n, t);
|
||||
let pinned = pinned_container_appearance(doc, &source)?;
|
||||
let mut out = (*n.appearance).clone();
|
||||
out.items = pinned.items;
|
||||
return Some(out);
|
||||
}
|
||||
let PreparedContainer { m, carry, .. } = prepare_container(Some(doc), n)?;
|
||||
let bounds = m.geometric_bounds()?;
|
||||
let mut out = (*n.appearance).clone();
|
||||
let mut changed = false;
|
||||
for (item, original) in out.items.iter_mut().zip(&n.appearance.items) {
|
||||
if paints(original)
|
||||
&& matches!(original.paint(), Paint::Gradient(g) if !g.is_placed())
|
||||
&& let Some(pinned) = crate::pinned_gradient_item(original, bounds, &[&carry])
|
||||
{
|
||||
*item = pinned;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
changed.then_some(out)
|
||||
}
|
||||
|
||||
/// Replace each visible member of `n` with geometry or Pathfinder effects of its own, at every
|
||||
/// depth of its groups and layers, by the art it draws ([`evaluate_container`],
|
||||
/// [`crate::reshape::own_effects_art`]), so the geometry effects of `n` reshape what its members
|
||||
|
||||
@@ -45,6 +45,7 @@ mod lighting_presets;
|
||||
mod live;
|
||||
mod marks;
|
||||
pub mod pixel;
|
||||
mod placement;
|
||||
pub mod preview;
|
||||
mod raster;
|
||||
mod reshape;
|
||||
@@ -75,12 +76,13 @@ pub use bake::{
|
||||
pub use clip::{WarpSeams, clip_outline, knockout_silhouette, reshaped_clip_outline, warp_pieces_translucent};
|
||||
pub use group::{
|
||||
OutlineHook, PATHFINDER_EFFECTS, compound_shape_area, compound_shape_art, evaluate_container, has_container_appearance, has_pathfinder,
|
||||
is_pathfinder, member_leaves, member_shapes, paints, pathfinder_children, shape_art,
|
||||
is_pathfinder, member_leaves, member_shapes, paints, pathfinder_children, pinned_container_appearance, shape_art,
|
||||
};
|
||||
pub use lighting_presets::{LIGHTING_PRESETS, LightingPreset, lighting_preset_params, matching_lighting_preset};
|
||||
pub use live::{expand_live, expand_live_deep, expanded_live_group, outline_object, text_outliner};
|
||||
pub use marks::{CROP_MARKS, crop_marks_art, has_crop_marks};
|
||||
pub use pixel::{PIXEL_EFFECTS, PixelFx, PixelSpace};
|
||||
pub use placement::pinned_gradient_item;
|
||||
pub use raster::{
|
||||
RASTERIZE, RasterFx, Rasterize, color_param, follow_items, item_effects_in, outset, raster_effects, rasterize_stage, stage_maps, staged_effects,
|
||||
without_geometry,
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//! Conservative stored placements for gradients fitted by the existing effects passes.
|
||||
|
||||
use vectorcraft_doc::color::{GradientKind, GradientPaint, Paint};
|
||||
use vectorcraft_doc::{Appearance, AppearanceItem};
|
||||
use vectorcraft_geom::Rect;
|
||||
|
||||
use crate::Carry;
|
||||
|
||||
/// Freeze one fitted gradient at the evaluated row's geometric bounds, before its live effects.
|
||||
/// `carries` are the actual object and item passes, in rendering order. Only missing placement
|
||||
/// fields are returned; explicit coordinates and the row's other data stay unchanged. A map or
|
||||
/// model that cannot reproduce the original resolved row returns `None`, leaving it fitted.
|
||||
pub fn pinned_gradient_item(item: &AppearanceItem, bounds: Rect, carries: &[&Carry]) -> Option<AppearanceItem> {
|
||||
if gradient(item)?.is_placed() {
|
||||
return Some(item.clone());
|
||||
}
|
||||
if ![bounds.x0, bounds.y0, bounds.x1, bounds.y1].iter().all(|v| v.is_finite()) {
|
||||
return None;
|
||||
}
|
||||
let resolved = resolve(item, bounds, carries);
|
||||
if !finite_placement(resolved.items.first()?) {
|
||||
return None;
|
||||
}
|
||||
let mut stored = resolved.clone();
|
||||
for carry in carries.iter().rev() {
|
||||
carry.unapply_placed(&mut stored)?;
|
||||
}
|
||||
if !finite_placement(stored.items.first()?) {
|
||||
return None;
|
||||
}
|
||||
let candidate = missing_placement(item, stored.items.first()?)?;
|
||||
let replayed = resolve(&candidate, bounds, carries);
|
||||
(finite_placement(replayed.items.first()?) && replayed.approx_eq(&resolved)).then_some(candidate)
|
||||
}
|
||||
|
||||
fn gradient(item: &AppearanceItem) -> Option<&GradientPaint> {
|
||||
match item.paint() {
|
||||
Paint::Gradient(g) => Some(g),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn resolve(item: &AppearanceItem, bounds: Rect, carries: &[&Carry]) -> Appearance {
|
||||
let mut ap = Appearance { items: vec![item.clone()], ..Default::default() };
|
||||
for carry in carries {
|
||||
carry.apply(&mut ap);
|
||||
}
|
||||
ap.pin_gradients(bounds);
|
||||
ap
|
||||
}
|
||||
|
||||
fn missing_placement(item: &AppearanceItem, placed: &AppearanceItem) -> Option<AppearanceItem> {
|
||||
let original = gradient(item)?;
|
||||
let placed = gradient(placed)?;
|
||||
let mut out = item.clone();
|
||||
let Paint::Gradient(g) = out.paint_mut() else { return None };
|
||||
if original.geom.is_none() {
|
||||
g.geom = placed.geom;
|
||||
}
|
||||
if original.gradient.kind == GradientKind::Freeform && !original.has_freeform_points() {
|
||||
let freeform = placed.freeform.as_ref()?;
|
||||
match &mut g.freeform {
|
||||
Some(f) => f.points.clone_from(&freeform.points),
|
||||
None => g.freeform = Some(freeform.clone()),
|
||||
}
|
||||
}
|
||||
Some(out)
|
||||
}
|
||||
|
||||
fn finite_placement(item: &AppearanceItem) -> bool {
|
||||
let Some(g) = gradient(item) else { return false };
|
||||
g.geom.is_none_or(|v| v.start.is_finite() && v.end.is_finite() && v.aspect.is_finite() && v.focal.is_none_or(|p| p.is_finite()))
|
||||
&& g.freeform.as_ref().is_none_or(|f| f.points.iter().all(|p| p.at.is_finite()))
|
||||
}
|
||||
@@ -3505,7 +3505,7 @@ pub(crate) fn follow_boxes(ap: &mut Appearance, from: Rect, to: Rect) {
|
||||
|
||||
/// The map that takes box `from` onto box `to` along each axis (along an axis `from` has no extent
|
||||
/// on, a move from its center to `to`'s).
|
||||
fn box_map(from: Rect, to: Rect) -> vectorcraft_geom::Affine {
|
||||
pub(crate) fn box_map(from: Rect, to: Rect) -> vectorcraft_geom::Affine {
|
||||
let axis = |a0: f64, a1: f64, b0: f64, b1: f64| {
|
||||
if (a1 - a0).abs() > 1e-12 {
|
||||
let s = (b1 - b0) / (a1 - a0);
|
||||
|
||||
@@ -74,6 +74,7 @@ pub mod perspgrid;
|
||||
pub mod place;
|
||||
pub mod plugin;
|
||||
pub(crate) mod plugin_call;
|
||||
mod preflight;
|
||||
pub mod prefscmds;
|
||||
pub mod print;
|
||||
pub(crate) mod printadvanced;
|
||||
@@ -98,7 +99,6 @@ pub(crate) mod symboledit;
|
||||
pub mod symbollib;
|
||||
pub(crate) mod tabs;
|
||||
mod textedit;
|
||||
mod xmlattrs;
|
||||
|
||||
pub use textedit::effective_kerning;
|
||||
pub mod textstyles;
|
||||
@@ -382,6 +382,7 @@ pub fn command_specs() -> &'static [CommandSpec] {
|
||||
v.extend(package::specs());
|
||||
v.extend(slices::specs());
|
||||
v.extend(print::specs());
|
||||
v.extend(preflight::specs());
|
||||
v.extend(recovery::specs());
|
||||
v.extend(fileio::dxfimport::specs());
|
||||
v.extend(webexport::specs());
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//! Common Tangents (`addon.pathtools.commonTangents`): the straight lines that touch two selected
|
||||
//! convex closed paths (ellipses at any rotation and scale, and convex Bézier paths) without
|
||||
//! crossing into either, added as separate open paths, with the line joining their centers if
|
||||
//! asked. The geometry is `vectorcraft_pathops::addons::pathtools::common_tangents`.
|
||||
//! asked. One of the two may be a point (a path of one anchor) instead: the lines then run from it
|
||||
//! to where they touch the path. The geometry is `vectorcraft_pathops::addons::pathtools::common_tangents`.
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -30,19 +31,24 @@ pub(super) fn specs() -> Vec<CommandSpec> {
|
||||
"Common Tangents",
|
||||
["Object", "Plug-ins", "Path Precision Tools"],
|
||||
None,
|
||||
"{tangents?: \"external\" (both paths on the same side of each line) | \"internal\" (the lines that run between them) | \"all\" (\"all\"), centerline?: bool (false: true also adds the line joining the two centers, an ellipse's center or a path's center of area), ids?: [id, id] (default: the selection)} add the common tangent lines of two convex closed paths as separate open paths, each from where it touches the first path to where it touches the second (the whole stretch where a straight side lies along it), stroked with the current stroke color and weight (black when the stroke is None) and unfilled, directly above the upper of the two, as one undo step; the new lines are selected. An ellipse drawn with the Ellipse tool, turned or scaled, is measured as an exact ellipse; any other path must be closed, have one outline, bend the same way all around and have at most 10000 segments. Separate paths have two external and two internal tangents; overlapping paths only external ones; one path inside the other has none. Paths that touch, from outside or from inside, share one tangent there instead: a line centered on the point where they touch and as long as the narrower path is wide along it; paths that meet at a corner or along a shared stretch of outline get one such line, at the middle of the directions that touch both. Paths count as touching when the gap between them is less than a billionth of the larger of their sizes and the distance between their centers. When there is no tangent of the kind asked for, nothing changes and the result has a `warning` → {ids, external, internal, centerline (its id or null), warning?}",
|
||||
"{tangents?: \"external\" (both paths on the same side of each line) | \"internal\" (the lines that run between them) | \"all\" (\"all\"), centerline?: bool (false: true also adds the line joining the two centers, an ellipse's center or a path's center of area), ids?: [id, id] (default: the selection)} add the common tangent lines of two convex closed paths as separate open paths, each from where it touches the first path to where it touches the second (the whole stretch where a straight side lies along it), stroked with the current stroke color and weight (black when the stroke is None) and unfilled, directly above the upper of the two, as one undo step; the new lines are selected. An ellipse drawn with the Ellipse tool, turned or scaled, is measured as an exact ellipse; any other path must be closed, have one outline, bend the same way all around and have at most 10000 segments. Separate paths have two external and two internal tangents; overlapping paths only external ones; one path inside the other has none. Paths that touch, from outside or from inside, share one tangent there instead: a line centered on the point where they touch and as long as the narrower path is wide along it; paths that meet at a corner or along a shared stretch of outline get one such line, at the middle of the directions that touch both. Paths count as touching when the gap between them is less than a billionth of the larger of their sizes and the distance between their centers. One of the two may be a point (a path of one anchor): the lines then run from the point to where they touch the path, two when the point lies outside it (one that lies along a straight side covers the whole side), one when the point lies on its outline, that is, less than the touching tolerance from it, with the point's distance from the path's center in place of the distance between centers (centered on the point and as long as the path is wide along it, or the whole straight side the point lies on), none when it lies inside; every `tangents` value gives the same lines, counted as internal when `tangents` is \"internal\" and as external otherwise, and the centerline runs from the point to the path's center; two points are refused. When there is no tangent of the kind asked for, nothing changes and the result has a `warning` → {ids, external, internal, centerline (its id or null), warning?}",
|
||||
has_selection,
|
||||
common_tangents
|
||||
)]
|
||||
}
|
||||
|
||||
/// The outline of path `id` as the geometry takes it: an exact ellipse for a whole live ellipse,
|
||||
/// else the path's one closed convex subpath.
|
||||
/// The outline of path `id` as the geometry takes it: a point for a path of one anchor, an exact
|
||||
/// ellipse for a whole live ellipse, else the path's one closed convex subpath.
|
||||
fn outline_of(d: &Document, id: NodeId) -> Result<pt::Outline> {
|
||||
const C: &str = COMMON_TANGENTS;
|
||||
let n = d.node(id).ok_or(EngineError::NoNode(id))?;
|
||||
let NodeKind::Path { path, live, .. } = &n.kind else { return Err(bad(C, "select two closed paths")) };
|
||||
let [sp] = path.subpaths.as_slice() else { return Err(bad(C, "select two closed paths")) };
|
||||
if sp.anchors.len() == 1
|
||||
&& let Some(only) = sp.anchors.first()
|
||||
{
|
||||
return pt::Outline::point(only.p).map_err(refusal);
|
||||
}
|
||||
if let Some(LiveShape::Ellipse { w, h, pie, xf }) = live.as_deref() {
|
||||
let span = (pie.1 - pie.0).rem_euclid(360.0);
|
||||
if span < 1e-9 || 360.0 - span < 1e-9 {
|
||||
@@ -74,17 +80,36 @@ fn common_tangents(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let ordered = d.paint_order(roots.iter().copied());
|
||||
let [first, second] = ordered.as_slice() else { return Err(bad(C, "select two closed paths")) };
|
||||
let (a, b) = (outline_of(d, *first)?, outline_of(d, *second)?);
|
||||
if a.is_point() && b.is_point() {
|
||||
return Err(bad(C, "select two closed paths"));
|
||||
}
|
||||
// A point goes first, so that each line runs from it to where it touches the path.
|
||||
let point = a.is_point() || b.is_point();
|
||||
let (a, b) = if b.is_point() { (b, a) } else { (a, b) };
|
||||
let all = pt::common_tangents(&a, &b).map_err(|_| bad(C, "the two paths have the same outline"))?;
|
||||
let external = all.iter().filter(|t| t.kind == pt::TangentKind::External).count();
|
||||
let keep = |t: &&pt::Tangent| match kinds {
|
||||
"external" => t.kind == pt::TangentKind::External,
|
||||
"internal" => t.kind == pt::TangentKind::Internal,
|
||||
_ => true,
|
||||
// A point's external and internal tangents are the same lines: every kind keeps them.
|
||||
let keep = |t: &&pt::Tangent| {
|
||||
point
|
||||
|| match kinds {
|
||||
"external" => t.kind == pt::TangentKind::External,
|
||||
"internal" => t.kind == pt::TangentKind::Internal,
|
||||
_ => true,
|
||||
}
|
||||
};
|
||||
let kept: Vec<&pt::Tangent> = all.iter().filter(keep).collect();
|
||||
let count = |kind: pt::TangentKind| kept.iter().filter(|t| t.kind == kind).count();
|
||||
let (external_kept, internal_kept) = (count(pt::TangentKind::External), count(pt::TangentKind::Internal));
|
||||
let (external_kept, internal_kept) = match (point, kinds) {
|
||||
(true, "internal") => (0, kept.len()),
|
||||
(true, _) => (kept.len(), 0),
|
||||
_ => (count(pt::TangentKind::External), count(pt::TangentKind::Internal)),
|
||||
};
|
||||
let lines: Vec<(Point, Point)> = kept.iter().map(|t| (t.from, t.to)).collect();
|
||||
if lines.is_empty() && point {
|
||||
// Written as `EngineError::Other` so that the i18n message scan finds it.
|
||||
let warning = EngineError::Other("The point lies inside the path, so it has no tangents".into());
|
||||
return Ok(json!({ "ids": [], "external": 0, "internal": 0, "centerline": null, "warning": warning.to_string() }));
|
||||
}
|
||||
if lines.is_empty() {
|
||||
// Written as `EngineError::Other` so that the i18n message scan finds them. Exactly one
|
||||
// external tangent means one path lies inside the other and touches it there; paths that
|
||||
|
||||
@@ -248,6 +248,84 @@ fn nested_and_overlapping_paths_change_nothing_and_say_why() {
|
||||
assert_eq!((r["external"].as_u64(), r["internal"].as_u64()), (Some(1), Some(0)), "{r}");
|
||||
}
|
||||
|
||||
fn point(s: &mut Session, x: f64, y: f64) -> NodeId {
|
||||
id_of(&s.execute("path.create", &json!({"anchors": [{"x": x, "y": y}]})).unwrap())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_point_and_an_ellipse_get_the_two_lines_from_the_point_and_the_centerline() {
|
||||
let mut s = session();
|
||||
// The point is drawn after the oval, so it is the upper object; the lines still start at it.
|
||||
let oval = id_of(&s.execute("shape.ellipse", &json!({"x": 260, "y": 170, "width": 80, "height": 60})).unwrap());
|
||||
let dot = point(&mut s, 100.0, 200.0);
|
||||
select(&mut s, &[oval, dot]);
|
||||
let before = steps(&s);
|
||||
let r = s.execute(C, &json!({"centerline": true})).unwrap();
|
||||
assert_eq!((r["external"].as_u64(), r["internal"].as_u64()), (Some(2), Some(0)), "{r}");
|
||||
assert_eq!(steps(&s), before + 1);
|
||||
let found = lines(&s, &r);
|
||||
assert_eq!(found.len(), 3, "two tangents and the centerline");
|
||||
let (p, c) = (Point::new(100.0, 200.0), Point::new(300.0, 200.0));
|
||||
// From (-200, 0) to an ellipse with semi-axes 40 and 30 about the origin: the touching points
|
||||
// are x = -a²/200 = -8, y = ±b √(1 - x²/a²).
|
||||
let y = 30.0 * (1.0f64 - (8.0f64 / 40.0).powi(2)).sqrt();
|
||||
for sy in [1.0, -1.0] {
|
||||
let touch = c + Vec2::new(-8.0, sy * y);
|
||||
assert!(found[..2].iter().any(|(a, b)| near(*a, p) && near(*b, touch)), "{touch:?} in {found:?}");
|
||||
}
|
||||
assert_eq!(r["centerline"], r["ids"][2]);
|
||||
assert!(near(found[2].0, p) && near(found[2].1, c), "{:?}", found[2]);
|
||||
// Every `tangents` value gives the same two lines.
|
||||
for (kind, external, internal) in [("external", 2, 0), ("internal", 0, 2)] {
|
||||
let r = s.execute(C, &json!({"ids": [oval.0, dot.0], "tangents": kind})).unwrap();
|
||||
assert_eq!((r["external"].as_u64(), r["internal"].as_u64()), (Some(external), Some(internal)), "{kind}: {r}");
|
||||
assert_eq!(lines(&s, &r).len(), 2, "{kind}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_point_below_the_path_still_starts_the_lines() {
|
||||
let mut s = session();
|
||||
// The point is drawn first, so it is the lower object and needs no swap.
|
||||
let dot = point(&mut s, 100.0, 200.0);
|
||||
let round = circle(&mut s, 300.0, 200.0, 50.0);
|
||||
let r = s.execute(C, &json!({"ids": [round.0, dot.0], "centerline": true})).unwrap();
|
||||
assert_eq!((r["external"].as_u64(), r["internal"].as_u64()), (Some(2), Some(0)), "{r}");
|
||||
let found = lines(&s, &r);
|
||||
assert_eq!(found.len(), 3, "two tangents and the centerline");
|
||||
let p = Point::new(100.0, 200.0);
|
||||
assert!(found.iter().all(|(a, _)| near(*a, p)), "every line starts at the point: {found:?}");
|
||||
// From 200 away to a circle of radius 50, each tangent is √(200² - 50²) long.
|
||||
let length = (200.0f64 * 200.0 - 50.0 * 50.0).sqrt();
|
||||
assert!(found[..2].iter().all(|(a, b)| (a.distance(*b) - length).abs() < 1e-6), "{found:?}");
|
||||
assert!(near(found[2].1, Point::new(300.0, 200.0)), "{:?}", found[2]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_point_on_or_inside_a_path_and_two_points() {
|
||||
let mut s = session();
|
||||
let round = circle(&mut s, 200.0, 200.0, 50.0);
|
||||
// On the circle: one line, centered on the point and as long as the circle is wide.
|
||||
let on = point(&mut s, 250.0, 200.0);
|
||||
let r = s.execute(C, &json!({"ids": [round.0, on.0]})).unwrap();
|
||||
assert_eq!(r["external"].as_u64(), Some(1), "{r}");
|
||||
let (p, q) = lines(&s, &r)[0];
|
||||
assert!((p.x - 250.0).abs() < 1e-5 && (q.x - 250.0).abs() < 1e-5 && (p.distance(q) - 100.0).abs() < 1e-5, "{p:?} {q:?}");
|
||||
// Inside: nothing changes, and the warning says why.
|
||||
let inside = point(&mut s, 210.0, 190.0);
|
||||
let before = (steps(&s), s.doc().unwrap().doc.node_count());
|
||||
let r = s.execute(C, &json!({"ids": [round.0, inside.0], "centerline": true})).unwrap();
|
||||
assert_eq!(r["ids"], json!([]));
|
||||
assert!(r["warning"].as_str().unwrap().contains("point lies inside the path"), "{r}");
|
||||
assert_eq!((steps(&s), s.doc().unwrap().doc.node_count()), before, "nothing changes");
|
||||
// Two points, or a point and an open path, are refused.
|
||||
let err = |s: &mut Session, p: Value| s.execute(C, &p).unwrap_err().to_string();
|
||||
assert!(err(&mut s, json!({"ids": [on.0, inside.0]})).contains("select two closed paths"));
|
||||
let open = id_of(&s.execute("path.create", &json!({"anchors": [{"x": 0, "y": 0}, {"x": 50, "y": 0}, {"x": 50, "y": 50}]})).unwrap());
|
||||
assert!(err(&mut s, json!({"ids": [open.0, on.0]})).contains("open"));
|
||||
assert_eq!((steps(&s), s.doc().unwrap().doc.node_count()), (before.0 + 1, before.1 + 1), "only the open path was added");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bad_selections_and_params_are_refused() {
|
||||
let mut s = session();
|
||||
|
||||
@@ -172,6 +172,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[
|
||||
BuiltinBrushLibrary { id: "art-ribbons", name: "Art Ribbons", make: art_ribbons },
|
||||
BuiltinBrushLibrary { id: "ink-and-wash", name: "Ink and Wash", make: ink_and_wash },
|
||||
BuiltinBrushLibrary { id: "calligraphic-nibs", name: "Calligraphic Nibs", make: calligraphic_nibs },
|
||||
BuiltinBrushLibrary { id: "pressure-sensitive", name: "Pressure Sensitive", make: pressure_sensitive },
|
||||
BuiltinBrushLibrary { id: "bristle-brushes", name: "Bristle Brushes", make: bristle_brushes },
|
||||
BuiltinBrushLibrary { id: "pattern-borders", name: "Pattern Borders", make: pattern_borders },
|
||||
BuiltinBrushLibrary { id: "scatter-shapes", name: "Scatter Shapes", make: scatter_shapes },
|
||||
@@ -374,6 +375,47 @@ fn bristle(name: &str, shape: BristleShape, [size, length, density, thickness, o
|
||||
Brush { name: name.into(), kind: BrushKind::Bristle(Bristle { shape, size, length, density, thickness, opacity, stiffness }) }
|
||||
}
|
||||
|
||||
/// Pressure Sensitive: four original marks whose art width or nib size responds to recorded pen
|
||||
/// pressure. Mouse paths keep the engine's neutral middle-pressure rendering.
|
||||
fn pressure_sensitive() -> BrushLibrary {
|
||||
let flex = black(band(100.0, 5.0, 48, |x| 0.5 * (x / 100.0 * std::f64::consts::TAU).sin()));
|
||||
let pulse = group(vec![
|
||||
black(band(100.0, 2.8, 64, |x| 1.4 * (x / 100.0 * 2.0 * std::f64::consts::TAU).sin())),
|
||||
black(shapes::ellipse(Rect::new(46.0, -2.2, 54.0, 2.2))),
|
||||
]);
|
||||
let art_pressure = |name: &str, art: Node, light: f64, heavy: f64| Brush {
|
||||
name: name.into(),
|
||||
kind: BrushKind::Art(ArtBrush {
|
||||
art,
|
||||
width: light,
|
||||
width_mode: Some(Variation::Pressure),
|
||||
width_max: Some(heavy),
|
||||
colorization: Colorization::Tints,
|
||||
..Default::default()
|
||||
}),
|
||||
};
|
||||
let nib_pressure = |name: &str, angle: f64, roundness: f64, size: f64, variation: f64| Brush {
|
||||
name: name.into(),
|
||||
kind: BrushKind::Calligraphic(Calligraphic {
|
||||
angle,
|
||||
roundness,
|
||||
size,
|
||||
variation: [0.0, 0.0, variation],
|
||||
modes: Some([Variation::Fixed, Variation::Fixed, Variation::Pressure]),
|
||||
}),
|
||||
};
|
||||
built(
|
||||
"Pressure Sensitive",
|
||||
Document::new(100.0, 100.0),
|
||||
vec![
|
||||
art_pressure("Flex Ribbon", flex, 35.0, 250.0),
|
||||
art_pressure("Pulse Stroke", pulse, 45.0, 280.0),
|
||||
nib_pressure("Round Flow", 0.0, 100.0, 7.0, 5.0),
|
||||
nib_pressure("Chisel Flow", 35.0, 25.0, 9.0, 7.0),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
/// Bristle Brushes: one bristle brush for each tip shape, from a fine liner to wide fans for
|
||||
/// blending and texture.
|
||||
fn bristle_brushes() -> BrushLibrary {
|
||||
|
||||
@@ -92,7 +92,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Eraser",
|
||||
[],
|
||||
None,
|
||||
"{points: [[x,y]…] or [[x,y,pressure]…] or [[x,y,pressure,tiltX,tiltY,rotation]…] (pen pressure 0..1, tilt −90..90°, barrel rotation 0..360° clockwise; pen values are checked as path.freehand checks them), size?: pt (10; from 0.1 to 1000), angle?: ° (0, −180–180: the tip's long axis counter-clockwise from level), roundness?: % (100, 1–100), angleMode?, roundnessMode?, sizeMode?: \"fixed\" (default) | \"random\" | \"pressure\" | \"tilt\" | \"bearing\" | \"rotation\" (Eraser Tool Options' variation menus; a varied angle turns either way, clockwise or counter-clockwise), angleVariation?: ° (0–180, default 0, either way: clockwise or counter-clockwise), roundnessVariation?: % (0–100, default 0), sizeVariation?: pt (0–1000, default 0)} or {rect: [x, y, width, height] (pt; the Eraser's Alt-drag marquee)} erase the stroke of an elliptical tip from paths (selected, or all) → {ids}. The tip is `size` across its long axis, which runs at `angle` counter-clockwise from horizontal; its short axis is `roundness` percent of the long one. A value whose mode is not fixed varies by up to its variation either way: random draws one value for the drag; pressure goes from the value less the variation where the pen presses lightest to the value plus it where it presses hardest (size on pressure as path.blob); tilt from less with the pen lying flat to more with it upright; bearing and rotation from less at −180° to more at 180° of the pen's lean direction or barrel turn. A drag without that pen reading (a mouse) erases at the value itself. An angle or roundness outside its range, an unknown mode, or a variation below 0 or past its range is refused with an error and erases nothing. `rect` in place of `points` erases everything inside the rectangle: closed paths lose its area, and open paths are cut where they cross its edges; the tip's size, angle, roundness and variations do not apply. A width or height of 0 or less, a value that is not a finite number, or `points` and `rect` together is an error. When nothing is erased, no undo step is added",
|
||||
"{points: [[x,y]…] or [[x,y,pressure]…] or [[x,y,pressure,tiltX,tiltY,rotation]…] (pen pressure 0..1, tilt −90..90°, barrel rotation 0..360° clockwise; pen values are checked as path.freehand checks them), size?: pt (10; from 0.1 to 1000), angle?: ° (0, −180–180: the tip's long axis counter-clockwise from level), roundness?: % (100, 1–100), angleMode?, roundnessMode?, sizeMode?: \"fixed\" (default) | \"random\" | \"pressure\" | \"tilt\" | \"bearing\" | \"rotation\" (Eraser Tool Options' variation menus; a varied angle turns either way, clockwise or counter-clockwise), angleVariation?: ° (0–180, default 0, either way: clockwise or counter-clockwise), roundnessVariation?: % (0–100, default 0), sizeVariation?: pt (0–1000, default 0)} or {rect: [x, y, width, height] (pt; the Eraser's Alt-drag marquee)} erase the stroke of an elliptical tip from paths (selected, or all) → {ids}. The tip is `size` across its long axis, which runs at `angle` counter-clockwise from horizontal; its short axis is `roundness` percent of the long one. A value whose mode is not fixed varies by up to its variation either way: random draws one value for the drag; pressure goes from the value less the variation where the pen presses lightest to the value plus it where it presses hardest (size on pressure as path.blob); tilt from less with the pen lying flat to more with it upright; bearing and rotation from less at −180° to more at 180° of the pen's lean direction or barrel turn. A drag without that pen reading (a mouse) erases at the value itself. An angle or roundness outside its range, an unknown mode, or a variation below 0 or past its range is refused with an error and erases nothing. `rect` in place of `points` erases everything inside the rectangle: closed paths and filled open paths without a visible painted stroke lose its area, and other open paths are cut where they cross its edges; the tip's size, angle, roundness and variations do not apply. A width or height of 0 or less, a value that is not a finite number, or `points` and `rect` together is an error. When nothing is erased, no undo step is added",
|
||||
has_doc,
|
||||
erase_region
|
||||
),
|
||||
|
||||
@@ -345,18 +345,46 @@ pub(super) fn target_paths(doc: &Document, sel: &Selection, area: Rect) -> Vec<N
|
||||
out
|
||||
}
|
||||
|
||||
/// Any visible non-None fill, including one below a topmost None.
|
||||
pub(super) fn has_fill(n: &Node) -> bool {
|
||||
n.appearance.items.iter().any(|item| item.is_fill() && item.visible() && !item.paint().is_none())
|
||||
}
|
||||
|
||||
/// A visible painted stroke keeps open paths on the existing outline-erasure route.
|
||||
pub(super) fn has_painted_stroke(n: &Node) -> bool {
|
||||
n.appearance.items.iter().any(
|
||||
|item| matches!(item, vectorcraft_doc::AppearanceItem::Stroke(stroke) if stroke.visible && !stroke.paint.is_none() && stroke.width > 0.0),
|
||||
)
|
||||
}
|
||||
|
||||
/// A container stroke that paints this target's open geometry. A clipping container's own
|
||||
/// paint follows its clipping outline, and a compound shape paints its combined area instead.
|
||||
/// Neither makes its descendants' implicit fill-closing edges into new stroked edges.
|
||||
pub(super) fn has_painted_ancestor_stroke(doc: &Document, id: NodeId) -> bool {
|
||||
doc.ancestry(id)
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.rev()
|
||||
.skip(1)
|
||||
.filter_map(|id| doc.node(id))
|
||||
.take_while(|node| !node.clips() && !node.is_compound_shape())
|
||||
.any(|node| matches!(node.kind, NodeKind::Group { .. } | NodeKind::Layer { .. }) && has_painted_stroke(node))
|
||||
}
|
||||
|
||||
/// [`target_paths`] for the tools that cut fills, with each target's geometry and fill rule: the
|
||||
/// members of a compound path whose members are all closed paths give the compound path itself,
|
||||
/// once, so its fill (holes included) is cut as one shape under its own fill rule.
|
||||
pub(super) fn fill_targets(doc: &Document, sel: &Selection, area: Rect) -> Result<Vec<(NodeId, PathData, FillRule)>> {
|
||||
let closed_compound = |n: &Node| {
|
||||
/// With `open_fills`, an open compound with a visible fill and no painted visible stroke does too.
|
||||
pub(super) fn fill_targets(doc: &Document, sel: &Selection, area: Rect, open_fills: bool) -> Result<Vec<(NodeId, PathData, FillRule)>> {
|
||||
let area_compound = |n: &Node| {
|
||||
let filled = open_fills && has_fill(n) && !has_painted_stroke(n) && !has_painted_ancestor_stroke(doc, n.id);
|
||||
matches!(&n.kind, NodeKind::Compound { children, .. }
|
||||
if children.iter().all(|c| matches!(&c.kind, NodeKind::Path { path, .. } if path.is_closed())))
|
||||
if children.iter().all(|c| matches!(&c.kind, NodeKind::Path { path, .. } if path.is_closed() || filled)))
|
||||
};
|
||||
let editable = doc.editable();
|
||||
let mut out: Vec<(NodeId, PathData, FillRule)> = vec![];
|
||||
for id in target_paths(doc, sel, area) {
|
||||
let compound = doc.parent_of(id).and_then(|p| doc.node(p)).filter(|p| closed_compound(p) && editable(p.id));
|
||||
let compound = doc.parent_of(id).and_then(|p| doc.node(p)).filter(|p| area_compound(p) && editable(p.id));
|
||||
let target = compound.map_or(id, |c| c.id);
|
||||
if out.iter().any(|t| t.0 == target) {
|
||||
continue;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
use super::common::{
|
||||
PenRecord, SIZE_VARIATIONS, SIZES, Sample, center_strokes, dist_to_polyline, fill_targets, ids_json, path_mut, path_of, points_param,
|
||||
poly_bounds, pressure_region, ranged, replace_with_pieces, samples_param, sibling_with, size_pressure, target_paths, usize_opt,
|
||||
PenRecord, SIZE_VARIATIONS, SIZES, Sample, center_strokes, dist_to_polyline, fill_targets, has_fill, has_painted_ancestor_stroke,
|
||||
has_painted_stroke, ids_json, path_mut, path_of, points_param, poly_bounds, pressure_region, ranged, replace_with_pieces, samples_param,
|
||||
set_geometry, sibling_with, size_pressure, target_paths, usize_opt,
|
||||
};
|
||||
use super::{
|
||||
Anchor, AnchorKind, Beside, BezPath, BoolOp, Cap, EngineError, FillRule, Join, NodeId, Paint, ParamCurve, PathData, Point, Rect, Result, Session,
|
||||
SubPath, Value, Vec2, bad, eraser_area, eraser_tip, f64_or, fill_contains, json, number_or, object_param, po,
|
||||
Anchor, AnchorKind, Beside, BezPath, BoolOp, Cap, Document, EngineError, FillRule, Join, NodeId, NodeKind, Paint, ParamCurve, PathData, Point,
|
||||
Rect, Result, Session, SubPath, Value, Vec2, bad, eraser_area, eraser_tip, f64_or, fill_contains, json, number_or, object_param, po,
|
||||
};
|
||||
use kurbo::{CubicBez, Line, PathSeg};
|
||||
use vectorcraft_brush::{Brush, BrushKind, Calligraphic, Variation};
|
||||
@@ -266,7 +267,7 @@ pub(super) fn knife(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let st = s.doc()?;
|
||||
let strip = po::outline_stroke(&PathData::single(SubPath::polyline(&pts, false)), KNIFE_GAP, Cap::Butt, Join::Round, 4.0);
|
||||
let mut plan: Vec<(NodeId, Vec<PathData>)> = vec![];
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, poly_bounds(&pts, 1.0))? {
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, poly_bounds(&pts, 1.0), false)? {
|
||||
if !pd.is_closed() {
|
||||
continue;
|
||||
}
|
||||
@@ -340,8 +341,9 @@ pub(super) fn erase_region(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
None => dist_to_polyline(&round, squash * q) <= r,
|
||||
};
|
||||
let mut plan: Vec<(NodeId, Vec<PathData>)> = vec![];
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, poly_bounds(&pts, reach))? {
|
||||
if pd.is_closed() {
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, poly_bounds(&pts, reach), true)? {
|
||||
if erase_as_area(&st.doc, id, &pd) {
|
||||
let pd = eraser_fill_operand(pd);
|
||||
if po::area(&po::boolean(&pd, rule, ®ion, FillRule::NonZero, BoolOp::Intersect), FillRule::NonZero) <= 1e-6 {
|
||||
continue;
|
||||
}
|
||||
@@ -353,6 +355,34 @@ pub(super) fn erase_region(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
apply_plan(s, "Eraser", plan)
|
||||
}
|
||||
|
||||
/// Whether the target is erased as filled area rather than as an open outline.
|
||||
fn erase_as_area(doc: &Document, id: NodeId, pd: &PathData) -> bool {
|
||||
// An unaggregated compound member keeps the outline route: its own appearance does not
|
||||
// paint it. Eligible fill-only compounds were collected as one parent target above.
|
||||
let compound_member =
|
||||
doc.parent_of(id).and_then(|parent| doc.node(parent)).is_some_and(|parent| matches!(parent.kind, NodeKind::Compound { .. }));
|
||||
let filled_open =
|
||||
!compound_member && !has_painted_ancestor_stroke(doc, id) && doc.node(id).is_some_and(|node| has_fill(node) && !has_painted_stroke(node));
|
||||
pd.is_closed() || filled_open
|
||||
}
|
||||
|
||||
/// Close only Eraser's temporary fill operand, preserving an open path's straight closing edge.
|
||||
fn eraser_fill_operand(mut pd: PathData) -> PathData {
|
||||
for sp in &mut pd.subpaths {
|
||||
if !sp.closed {
|
||||
// These endpoint handles are unused by an open path. Closing it must not activate them.
|
||||
if let Some(first) = sp.anchors.first_mut() {
|
||||
first.h_in = first.p;
|
||||
}
|
||||
if let Some(last) = sp.anchors.last_mut() {
|
||||
last.h_out = last.p;
|
||||
}
|
||||
sp.closed = true;
|
||||
}
|
||||
}
|
||||
pd
|
||||
}
|
||||
|
||||
/// `path.eraseRegion`'s `rect: [x, y, width, height]`: four finite numbers, with a width and a
|
||||
/// height above 0.
|
||||
fn marquee_param(v: &Value, cmd: &str) -> Result<Rect> {
|
||||
@@ -369,7 +399,7 @@ fn marquee_param(v: &Value, cmd: &str) -> Result<Rect> {
|
||||
}
|
||||
|
||||
/// `path.eraseRegion` with a marquee: everything inside `r` is erased from the paths (selected, or
|
||||
/// all). Closed paths lose the rectangle's area, and open paths are cut where they cross its edges.
|
||||
/// all). Closed paths and fill-only open paths lose the rectangle's area; other open paths are cut where they cross its edges.
|
||||
fn erase_rect(s: &mut Session, r: Rect) -> Result<Value> {
|
||||
let region =
|
||||
PathData::single(SubPath::polyline(&[Point::new(r.x0, r.y0), Point::new(r.x1, r.y0), Point::new(r.x1, r.y1), Point::new(r.x0, r.y1)], true));
|
||||
@@ -392,8 +422,9 @@ fn erase_rect(s: &mut Session, r: Rect) -> Result<Value> {
|
||||
};
|
||||
let st = s.doc()?;
|
||||
let mut plan: Vec<(NodeId, Vec<PathData>)> = vec![];
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, r)? {
|
||||
if pd.is_closed() {
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, r, true)? {
|
||||
if erase_as_area(&st.doc, id, &pd) {
|
||||
let pd = eraser_fill_operand(pd);
|
||||
if po::area(&po::boolean(&pd, rule, ®ion, FillRule::NonZero, BoolOp::Intersect), FillRule::NonZero) <= 1e-6 {
|
||||
continue;
|
||||
}
|
||||
@@ -492,8 +523,9 @@ fn erase_varied(s: &mut Session, samples: &[Sample], tip: [f64; 3], vary: [(Vari
|
||||
let short = low(2).max(MIN_BRUSH_SIZE) * low(1).clamp(1.0, 100.0) / 100.0;
|
||||
let reach = (size + sv) / 2.0;
|
||||
let mut plan: Vec<(NodeId, Vec<PathData>)> = vec![];
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, poly_bounds(&pts, reach))? {
|
||||
if pd.is_closed() {
|
||||
for (id, pd, rule) in fill_targets(&st.doc, &st.selection, poly_bounds(&pts, reach), true)? {
|
||||
if erase_as_area(&st.doc, id, &pd) {
|
||||
let pd = eraser_fill_operand(pd);
|
||||
if po::area(&po::boolean(&pd, rule, ®ion, FillRule::NonZero, BoolOp::Intersect), FillRule::NonZero) <= 1e-6 {
|
||||
continue;
|
||||
}
|
||||
@@ -510,10 +542,36 @@ fn apply_plan(s: &mut Session, label: &str, plan: Vec<(NodeId, Vec<PathData>)>)
|
||||
return Ok(json!({ "ids": [] }));
|
||||
}
|
||||
let ids = s.edit(label, |d, sel| {
|
||||
// Measure every original painting owner before any geometry or appearance changes.
|
||||
// This includes a Compound above a Path Eraser target and containers above live art.
|
||||
let owners: std::collections::BTreeSet<_> = plan.iter().flat_map(|(id, _)| d.ancestry(*id).unwrap_or_default()).collect();
|
||||
let pinned: Vec<_> = owners
|
||||
.into_iter()
|
||||
.filter_map(|id| {
|
||||
let node = d.node(id)?;
|
||||
if !node.appearance.has_unplaced_gradient() {
|
||||
return None;
|
||||
}
|
||||
vectorcraft_render::pinned_appearance_for_geometry_edit(d, node).map(|appearance| (id, appearance))
|
||||
})
|
||||
.collect();
|
||||
for (id, appearance) in pinned {
|
||||
if let Some(node) = d.node_mut(id) {
|
||||
node.appearance = appearance.into();
|
||||
}
|
||||
}
|
||||
let mut all = vec![];
|
||||
let mut cut = Beside::replacing(d, &plan.iter().map(|(id, _)| *id).collect::<Vec<_>>());
|
||||
for (id, pieces) in plan {
|
||||
all.extend(replace_with_pieces(d, &mut cut, id, pieces)?);
|
||||
let clipping_path = d.position(id).is_some_and(|(parent, i, _)| i == 0 && parent.and_then(|p| d.node(p)).is_some_and(|p| p.clips()));
|
||||
if clipping_path {
|
||||
// Keep every clipping contour in its original first child slot. An empty mask
|
||||
// must also stay there so the clipped artwork cannot become the new mask.
|
||||
set_geometry(d, id, PathData::new(pieces.into_iter().flat_map(|p| p.subpaths).collect()))?;
|
||||
all.push(id);
|
||||
} else {
|
||||
all.extend(replace_with_pieces(d, &mut cut, id, pieces)?);
|
||||
}
|
||||
}
|
||||
cut.finish(d)?;
|
||||
sel.set(all.iter().copied());
|
||||
|
||||
@@ -532,6 +532,24 @@ pub(super) fn export_overflow_warning(d: &Document, layers: &[Arc<Node>], areas:
|
||||
super::typecmd::export_overflow_warning(&overflow)
|
||||
}
|
||||
|
||||
/// The objects behind production findings. Resource art points to its first visible owner on
|
||||
/// the canvas, so a finding can be located without selecting an id outside the layer tree.
|
||||
#[derive(Default)]
|
||||
pub(super) struct PreflightType {
|
||||
pub fonts: BTreeMap<UsedFont, BTreeSet<NodeId>>,
|
||||
pub overflow: BTreeSet<NodeId>,
|
||||
pub images: BTreeMap<NodeId, NodeId>,
|
||||
}
|
||||
|
||||
pub(super) fn preflight_type(d: &Document, layers: &[Arc<Node>], areas: &[Rect]) -> PreflightType {
|
||||
let mut walk = Printed::new(d);
|
||||
walk.preflight = Some(PreflightType::default());
|
||||
for l in layers {
|
||||
walk.node(l, Some(areas));
|
||||
}
|
||||
walk.preflight.unwrap_or_default()
|
||||
}
|
||||
|
||||
/// The walk of [`printed_type`].
|
||||
struct Printed<'a> {
|
||||
d: &'a Document,
|
||||
@@ -546,13 +564,25 @@ struct Printed<'a> {
|
||||
/// The symbols and patterns whose art was walked.
|
||||
symbols: BTreeSet<String>,
|
||||
patterns: BTreeSet<String>,
|
||||
preflight: Option<PreflightType>,
|
||||
owner: Option<NodeId>,
|
||||
}
|
||||
|
||||
impl<'a> Printed<'a> {
|
||||
/// A walk of `d` among its own objects, nothing found yet.
|
||||
fn new(d: &'a Document) -> Self {
|
||||
let boxes = d.symbol_boxes();
|
||||
Self { d, boxes, own: true, fonts: BTreeSet::new(), overflow: BTreeSet::new(), symbols: BTreeSet::new(), patterns: BTreeSet::new() }
|
||||
Self {
|
||||
d,
|
||||
boxes,
|
||||
own: true,
|
||||
fonts: BTreeSet::new(),
|
||||
overflow: BTreeSet::new(),
|
||||
symbols: BTreeSet::new(),
|
||||
patterns: BTreeSet::new(),
|
||||
preflight: None,
|
||||
owner: None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds the fonts of `n` and its descendants that print, and the ids of those that don't fit
|
||||
@@ -560,6 +590,15 @@ impl<'a> Printed<'a> {
|
||||
/// art of a symbol, opacity mask, pattern or placed document, in brush pieces, or in a live
|
||||
/// object) all of them but those outside the clipping path of a clip group.
|
||||
fn node(&mut self, n: &Node, areas: Option<&[Rect]>) {
|
||||
let previous = self.owner;
|
||||
if self.own {
|
||||
self.owner = Some(n.id);
|
||||
}
|
||||
self.node_contents(n, areas);
|
||||
self.owner = previous;
|
||||
}
|
||||
|
||||
fn node_contents(&mut self, n: &Node, areas: Option<&[Rect]>) {
|
||||
if !n.visible || matches!(n.kind, NodeKind::Layer { template: true, .. }) {
|
||||
return;
|
||||
}
|
||||
@@ -571,6 +610,14 @@ impl<'a> Printed<'a> {
|
||||
&& !open
|
||||
&& !self.meets(n, a)
|
||||
{
|
||||
// An entirely overset frame paints nothing, but is still a delivery problem. Keep
|
||||
// the export walk unchanged; only preflight checks the frame itself in this case.
|
||||
if let (Some(p), Some(owner), NodeKind::Text(t)) = (&mut self.preflight, self.owner, &n.kind)
|
||||
&& n.geometric_bounds().is_some_and(|b| a.iter().any(|r| r.intersect(b).area() > 0.0 || r.contains_rect(b)))
|
||||
&& vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t).overflow
|
||||
{
|
||||
p.overflow.insert(owner);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// The art that its opacity mask, pattern paints and brushed strokes draw.
|
||||
@@ -616,16 +663,33 @@ impl<'a> Printed<'a> {
|
||||
if overflows && self.own {
|
||||
self.overflow.insert(n.id);
|
||||
}
|
||||
if overflows && let (Some(p), Some(owner)) = (&mut self.preflight, self.owner) {
|
||||
p.overflow.insert(owner);
|
||||
}
|
||||
for r in runs {
|
||||
self.fonts.extend(run_fonts(r));
|
||||
let fonts = run_fonts(r);
|
||||
if let (Some(p), Some(owner)) = (&mut self.preflight, self.owner) {
|
||||
for font in &fonts {
|
||||
p.fonts.entry(font.clone()).or_default().insert(owner);
|
||||
}
|
||||
}
|
||||
self.fonts.extend(fonts);
|
||||
// Inline graphics draw their symbols' art.
|
||||
if let Some(art) = r.inline.as_ref().filter(|_| draws_inline(r)) {
|
||||
self.symbol(&art.symbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
NodeKind::Image(_) => {
|
||||
if let (Some(p), Some(owner)) = (&mut self.preflight, self.owner) {
|
||||
p.images.entry(n.id).or_insert(owner);
|
||||
}
|
||||
}
|
||||
NodeKind::SymbolInstance { symbol, .. } => self.symbol(symbol),
|
||||
NodeKind::PlacedDocument(p) => {
|
||||
if let (Some(report), Some(owner)) = (&mut self.preflight, self.owner) {
|
||||
report.images.entry(n.id).or_insert(owner);
|
||||
}
|
||||
for art in p.art(n) {
|
||||
self.art(&art);
|
||||
}
|
||||
|
||||
@@ -1152,6 +1152,13 @@ pub fn read_info(p: &Value) -> Result<Value> {
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// Resolution at a placed image's transform: 72 points per inch over each pixel axis.
|
||||
pub(super) fn effective_ppi(xf: Affine) -> [f64; 2] {
|
||||
let [a, b, c, d, ..] = xf.as_coeffs();
|
||||
let ppi = |x: f64, y: f64| Some(x.hypot(y)).filter(|l| *l > 1e-12).map_or(0.0, |l| 72.0 / l);
|
||||
[ppi(a, b), ppi(c, d)]
|
||||
}
|
||||
|
||||
pub(crate) fn image_info(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
const C: &str = "image.info";
|
||||
let st = s.doc()?;
|
||||
@@ -1165,9 +1172,6 @@ pub(crate) fn image_info(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let doc = super::links::with_brush_art(&st.doc);
|
||||
let n = doc.stored_node(id).map(|(n, _)| &**n).ok_or(EngineError::NoNode(id))?;
|
||||
let NodeKind::Image(im) = &n.kind else { return Err(bad(C, format!("object {} is not an image", id.0))) };
|
||||
// Effective resolution: 72 pt per inch over the points one pixel spans along each axis.
|
||||
let [a, b, c, d, ..] = im.xf.as_coeffs();
|
||||
let ppi = |x: f64, y: f64| Some(x.hypot(y)).filter(|l| *l > 1e-12).map_or(0.0, |l| 72.0 / l);
|
||||
let size = n.geometric_bounds().unwrap_or_default();
|
||||
// A linked file outside the read roots of the caller asking now is left unnamed, as in Link Info.
|
||||
let doc_path = super::links::LinkBase::of(st).doc;
|
||||
@@ -1179,7 +1183,7 @@ pub(crate) fn image_info(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
"colorMode": st.doc.images.get(&im.key).map_or("RGB", |b| color_mode(&b.bytes)),
|
||||
"pixelWidth": im.width,
|
||||
"pixelHeight": im.height,
|
||||
"ppi": [ppi(a, b), ppi(c, d)],
|
||||
"ppi": effective_ppi(im.xf),
|
||||
"width": size.width(),
|
||||
"height": size.height(),
|
||||
}))
|
||||
|
||||
@@ -171,8 +171,6 @@ fn parse(xml: &str, name: &str, cmd: &str) -> Result<El> {
|
||||
craft_xml::Error::TooDeep(_) => bad(cmd, format!("`{name}` in the Word document nests elements more than {MAX_NESTING} deep")),
|
||||
_ => bad(cmd, format!("`{name}` in the Word document is not well-formed XML: {e}")),
|
||||
})?;
|
||||
crate::cmd::xmlattrs::validate(xml.as_bytes(), opts.limits)
|
||||
.map_err(|e| bad(cmd, format!("`{name}` in the Word document is not well-formed XML: {e}")))?;
|
||||
Ok(doc)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
//! Production preflight: the existing output-aware type walk, linked-file probes and image
|
||||
//! resolution calculation, returned as findings that the interface can locate and recheck.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::NodeId;
|
||||
use vectorcraft_text::{FontDb, FontMatch};
|
||||
|
||||
use super::{CommandSpec, Result, Session, bad, cmd, has_doc, number_or, text_param};
|
||||
|
||||
const COMMAND: &str = "document.preflight";
|
||||
const KINDS: [&str; 4] = ["fonts", "text", "links", "resolution"];
|
||||
|
||||
pub fn specs() -> Vec<CommandSpec> {
|
||||
vec![cmd!(
|
||||
query "document.preflight",
|
||||
"Production Preflight",
|
||||
[],
|
||||
None,
|
||||
"{output?: pdf|print|screen (pdf), minPpi?: 1..9600 (300, or 96 for screen), artboards?: [index, …] (0-based whole numbers; default all)} check the selected output without writing files or editing the document; print reuses the saved print settings with these artboards, pdf and screen check visible artwork on these artboards. Reuses output-aware font and overflow checks, Links file status and image.info effective resolution. Resource findings locate their first visible canvas owner; resolution inside resource art is reported as not checked because its placed scale can differ. → {output, minPpi, artboards, checks: [{kind: fonts|text|links|resolution, status: passed|failed|notChecked, count, notChecked}], findings: [{kind, code, ids (canvas objects), name, detail?, sourceId?, effectivePpi?, threshold?}], outputWarnings, limitations}; a pass covers only these checks, not certification of a produced file",
|
||||
has_doc,
|
||||
check
|
||||
)]
|
||||
}
|
||||
|
||||
fn check(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let output = text_param(p, "output", COMMAND)?.unwrap_or("pdf");
|
||||
if !matches!(output, "pdf" | "print" | "screen") {
|
||||
return Err(bad(COMMAND, "output must be pdf, print or screen"));
|
||||
}
|
||||
let min_ppi = number_or(p, "minPpi", if output == "screen" { 96.0 } else { 300.0 }, COMMAND)?;
|
||||
if !min_ppi.is_finite() || !(1.0..=9600.0).contains(&min_ppi) {
|
||||
return Err(bad(COMMAND, "minPpi must be from 1 to 9600"));
|
||||
}
|
||||
let indices = match p.get("artboards").filter(|v| !v.is_null()) {
|
||||
Some(v) => super::panelcmds::listed_artboards(&s.doc()?.doc, v, "artboards", COMMAND)?,
|
||||
None => (0..s.doc()?.doc.artboards.len()).collect(),
|
||||
};
|
||||
let context = if output == "print" {
|
||||
super::print::preflight_context(s, &indices)?
|
||||
} else {
|
||||
let doc = &s.doc()?.doc;
|
||||
let pages = indices.iter().filter_map(|i| doc.artboards.get(*i).map(|a| (a.rect, vectorcraft_geom::Affine::IDENTITY))).collect();
|
||||
super::print::PreflightContext { layers: vectorcraft_pdf::PrintLayers::Visible, pages, warnings: vec![] }
|
||||
};
|
||||
let areas = context.pages.iter().map(|(r, _)| *r).collect::<Vec<_>>();
|
||||
let st = s.doc()?;
|
||||
let doc = st.doc.with_placed_art();
|
||||
let mut layers = doc.layers.clone();
|
||||
vectorcraft_pdf::keep_layers(&mut layers, context.layers);
|
||||
let typed = super::fonts::preflight_type(&doc, &layers, &areas);
|
||||
let statuses = super::links::statuses(st);
|
||||
let mut findings = vec![];
|
||||
let db = FontDb::global();
|
||||
for (font, ids) in typed.fonts {
|
||||
let code = match db.resolve(&font.0, &font.1).map(|(_, m)| m) {
|
||||
None | Some(FontMatch::Missing) => "missingFont",
|
||||
Some(FontMatch::Style) => "substitutedFont",
|
||||
_ => continue,
|
||||
};
|
||||
findings.push(
|
||||
json!({ "kind": "fonts", "code": code, "ids": ids.iter().map(|i| i.0).collect::<Vec<_>>(), "name": super::fonts::font_label(&font) }),
|
||||
);
|
||||
}
|
||||
for id in typed.overflow {
|
||||
findings.push(finding("text", "overflow", id, &doc));
|
||||
}
|
||||
let mut resolution_unchecked = 0usize;
|
||||
for (source, owner) in typed.images {
|
||||
if let Some((status, _, _)) = statuses.get(&source) {
|
||||
let code = match status.as_str() {
|
||||
"missing" => Some("missingLink"),
|
||||
"modified" => Some("modifiedLink"),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(code) = code {
|
||||
let mut f = finding("links", code, owner, &doc);
|
||||
f["sourceId"] = json!(source.0);
|
||||
findings.push(f);
|
||||
}
|
||||
}
|
||||
// A vector placed document has no single bitmap resolution. Its embedded artwork, and
|
||||
// resources with their own coordinate systems, must never be certified at a local scale.
|
||||
if doc.node(source).is_none() || source != owner {
|
||||
resolution_unchecked += 1;
|
||||
continue;
|
||||
}
|
||||
let Some(vectorcraft_doc::NodeKind::Image(im)) = doc.node(source).map(|n| &n.kind) else {
|
||||
resolution_unchecked += 1;
|
||||
continue;
|
||||
};
|
||||
let bounds = doc.node(source).and_then(|n| vectorcraft_render::painted_bounds(&doc, n));
|
||||
let ppi = context
|
||||
.pages
|
||||
.iter()
|
||||
.filter(|(area, _)| bounds.is_some_and(|b| area.intersect(b).area() > 0.0))
|
||||
.map(|(_, to_page)| super::place::effective_ppi(*to_page * im.xf))
|
||||
.reduce(|[a, b], [c, d]| [a.min(c), b.min(d)]);
|
||||
let Some(ppi) = ppi else {
|
||||
resolution_unchecked += 1;
|
||||
continue;
|
||||
};
|
||||
// Inverting the placed-size transform can round an exact threshold slightly down.
|
||||
if ppi.iter().any(|n| !n.is_finite() || *n <= 0.0) {
|
||||
resolution_unchecked += 1;
|
||||
} else if ppi.iter().any(|n| *n < min_ppi * (1.0 - 1e-9)) {
|
||||
let mut f = finding("resolution", "lowResolution", owner, &doc);
|
||||
f["effectivePpi"] = json!(ppi);
|
||||
f["threshold"] = json!(min_ppi);
|
||||
findings.push(f);
|
||||
}
|
||||
}
|
||||
let checks = KINDS.map(|kind| {
|
||||
let count = findings.iter().filter(|f| f["kind"] == kind).count();
|
||||
let not_checked = if kind == "resolution" { resolution_unchecked } else { 0 };
|
||||
let status = if count > 0 {
|
||||
"failed"
|
||||
} else if not_checked > 0 {
|
||||
"notChecked"
|
||||
} else {
|
||||
"passed"
|
||||
};
|
||||
json!({ "kind": kind, "status": status, "count": count, "notChecked": not_checked })
|
||||
});
|
||||
Ok(json!({
|
||||
"output": output, "minPpi": min_ppi, "artboards": indices, "checks": checks,
|
||||
"findings": findings, "outputWarnings": context.warnings,
|
||||
"limitations": ["These checks do not certify an exported file.", "Resolution inside symbols, patterns, brushes, opacity masks and placed documents is not checked."]
|
||||
}))
|
||||
}
|
||||
|
||||
fn finding(kind: &str, code: &str, id: NodeId, doc: &vectorcraft_doc::Document) -> Value {
|
||||
json!({ "kind": kind, "code": code, "ids": [id.0], "name": doc.node(id).map(|n| n.display_name()).unwrap_or_else(|| id.0.to_string()) })
|
||||
}
|
||||
@@ -147,6 +147,32 @@ fn preview(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Ok(v)
|
||||
}
|
||||
|
||||
/// Reuse the Print dialog's saved settings and page geometry for production preflight, without
|
||||
/// printing, writing a file or duplicating its type warnings.
|
||||
pub(super) struct PreflightContext {
|
||||
pub layers: PrintLayers,
|
||||
pub pages: Vec<(Rect, Affine)>,
|
||||
pub warnings: Vec<String>,
|
||||
}
|
||||
|
||||
pub(super) fn preflight_context(s: &Session, indices: &[usize]) -> Result<PreflightContext> {
|
||||
let settings =
|
||||
json!({ "settings": { "artboards": "range", "range": indices.iter().map(|i| (i + 1).to_string()).collect::<Vec<_>>().join(",") } });
|
||||
let set = preset_or_saved("document.preflight", s, &s.doc()?.doc, &settings)?;
|
||||
super::printadvanced::flattener("document.preflight", &set, &s.prefs.flattener_presets)?;
|
||||
let mut pv = vectorcraft_pdf::preview(&s.doc()?.doc, &set).map_err(|e| pdf_error("document.preflight", e))?;
|
||||
let pages = pv
|
||||
.sheets
|
||||
.iter()
|
||||
.filter_map(|p| {
|
||||
let to_page = Affine::new(p.transform);
|
||||
on_page(Rect::new(p.area[0], p.area[1], p.area[2], p.area[3]), to_page, (p.width, p.height)).map(|area| (area, to_page))
|
||||
})
|
||||
.collect();
|
||||
pv.warnings.extend(pv.setting_notes);
|
||||
Ok(PreflightContext { layers: set.print_layers, pages, warnings: pv.warnings })
|
||||
}
|
||||
|
||||
/// The parts of the document (document space) that the pages of `pv` print.
|
||||
fn areas(pv: &PrintPreview) -> Vec<Rect> {
|
||||
pv.sheets
|
||||
|
||||
@@ -250,7 +250,6 @@ fn parse_library(xml: &str, cmd: &str, text_only: bool) -> Result<Library> {
|
||||
craft_xml::Error::TooDeep(_) => bad(cmd, format!("the variable library nests elements more than {MAX_LIBRARY_NESTING} deep")),
|
||||
_ => bad(cmd, format!("the variable library is not well-formed XML: {e}")),
|
||||
})?;
|
||||
crate::cmd::xmlattrs::validate(xml.as_bytes(), opts.limits).map_err(|e| bad(cmd, format!("the variable library is not well-formed XML: {e}")))?;
|
||||
let Some(root) = std::iter::once(&doc).chain(doc.descendants()).find(|n| n.is(craft_xml::Local("variableSets"))) else {
|
||||
return Err(bad(cmd, "the file holds no `variableSets` element"));
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Save for Web",
|
||||
[],
|
||||
None,
|
||||
"{path?, preset?: a webExport.presets name (its settings, then these keys), format?: gif (default)|jpg|png8|png24, reduction?: perceptual|selective (default)|adaptive|web|blackWhite|gray (gif/png8, as the next five), colors?: 128 (2–256), dither?: none|diffusion (default)|pattern|noise, ditherAmount?: 100, webSnap?: 0 (0–100 %: colours that close to a web-safe one become it), lossy?: 0 (0–100, gif), colorTable?: {locked?: [\"#rrggbb\"…] (kept when reducing), transparent?: [\"#rrggbb\"…] (become transparent), webShift?: [\"#rrggbb\"…] (become web-safe), sort?: none|hue|luminance|popularity, deleted?: [\"#rrggbb\"…] (taken out of the table: their pixels take the nearest color left, and at least one color stays), customPalette?: [\"#rrggbb\"…] (a fixed palette used instead of the reduction's, at most `colors` entries; a new reduction without colorTable clears it and deleted)} (colours as the preview's colors[].source; #rrggbbaa and #rgba are refused here and in matte), transparency?: true (gif/png8/png24), matte?: white (default)|black|none|\"#rrggbb\" (what edges blend into; jpg and opaque png24: the background), interlaced?: false (gif/png8/png24), quality?: 60 (jpg: 0–100), progressive?: false (jpg), optimized?: true (jpg), embedProfile?: false (jpg: sRGB profile), width?: px | height?: px | percent?: 100 (the image size, proportional; width wins over height, height over percent), antiAlias?: none|art (default)|type, clipToArtboard?: true (the artboard; false: the art and the slices), artboard?: 0 (0-based), convertToSrgb?: true (PNG files say they are sRGB), metadata?: none|copyright (default)|contact|all (File Info written as PNG text, a GIF or JPEG comment), slices?: all (default)|selected|none (one image per slice: images/<slice name>.<ext>), output?: images (default)|html (an HTML page placing the image or slices, <stem>.html)} → {path, files: [path…], bytes (total), width, height, warnings: [] or [a note that an image couldn't be decoded and is missing from the image]}; no path → {files: [{name, dataBase64}], bytes, width, height, warnings} (names such as page.html, images/page_01.gif). A single image without HTML is written at path itself",
|
||||
"{path?, preset?: a webExport.presets name (its settings, then these keys), format?: gif (default)|jpg|png8|png24, reduction?: perceptual|selective (default)|adaptive|web|blackWhite|gray (gif/png8, as the next five), colors?: 128 (2–256), dither?: none|diffusion (default)|pattern|noise, ditherAmount?: 100, webSnap?: 0 (0–100 %: colours that close to a web-safe one become it), lossy?: 0 (0–100, gif), colorTable?: {locked?: [\"#rrggbb\"…] (kept when reducing), transparent?: [\"#rrggbb\"…] (become transparent), webShift?: [\"#rrggbb\"…] (become web-safe), sort?: none|hue|luminance|popularity, deleted?: [\"#rrggbb\"…] (taken out of the table: their pixels take the nearest color left, and at least one color stays), customPalette?: [\"#rrggbb\"…] (a fixed palette used instead of the reduction's, at most `colors` entries, its transparent colors taking one slot together; a new reduction without colorTable clears it and deleted), shifted?: {\"#source\": \"#rrggbb\"…} (each source color is written as the color given, wherever it is in the image; kept when reducing as a locked color is, before the locked ones, while one palette slot is left for the reduction; at most 256; a source the table does not hold shifts nothing; a color shifted to itself is removed; a shifted color is not web-shifted, and a transparent one stays transparent; GIF lossy moves no pixel into or out of a shifted color)} (colours as the preview's colors[].source; #rrggbbaa and #rgba are refused here and in matte), transparency?: true (gif/png8/png24), matte?: white (default)|black|none|\"#rrggbb\" (what edges blend into; jpg and opaque png24: the background), interlaced?: false (gif/png8/png24), quality?: 60 (jpg: 0–100), progressive?: false (jpg), optimized?: true (jpg), embedProfile?: false (jpg: sRGB profile), width?: px | height?: px | percent?: 100 (the image size, proportional; width wins over height, height over percent), antiAlias?: none|art (default)|type, clipToArtboard?: true (the artboard; false: the art and the slices), artboard?: 0 (0-based), convertToSrgb?: true (PNG files say they are sRGB), metadata?: none|copyright (default)|contact|all (File Info written as PNG text, a GIF or JPEG comment), slices?: all (default)|selected|none (one image per slice: images/<slice name>.<ext>), output?: images (default)|html (an HTML page placing the image or slices, <stem>.html)} → {path, files: [path…], bytes (total), width, height, warnings: [] or [a note that an image couldn't be decoded and is missing from the image]}; no path → {files: [{name, dataBase64}], bytes, width, height, warnings} (names such as page.html, images/page_01.gif). A single image without HTML is written at path itself",
|
||||
has_doc,
|
||||
export
|
||||
),
|
||||
@@ -41,7 +41,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Save for Web Preview",
|
||||
[],
|
||||
None,
|
||||
"{…the settings of document.exportForWeb (preset?, format?…), slice?: n (1-based, from slice.list; default the whole image), kbps?: 56.6 (connection speed for the download time), image?: false (also the optimised file as dataBase64)} what Save writes for the whole image (or one slice) → {format, width, height, bytes (exactly the file's size), seconds (to download at kbps), kbps, colors?: [{color: \"#rrggbb\", source: \"#rrggbb\" (the colour the reduction made, as colorTable lists it), transparent, locked, webShifted, webSafe}] (gif/png8: the colour table in file order), mappedToTransparent?: [\"#rrggbb\"…], slices: images an export writes, warnings (as document.exportForWeb's), dataBase64?}",
|
||||
"{…the settings of document.exportForWeb (preset?, format?…), slice?: n (1-based, from slice.list; default the whole image), kbps?: 56.6 (connection speed for the download time), image?: false (also the optimised file as dataBase64)} what Save writes for the whole image (or one slice) → {format, width, height, bytes (exactly the file's size), seconds (to download at kbps), kbps, colors?: [{color: \"#rrggbb\", source: \"#rrggbb\" (the colour the reduction made, as colorTable lists it), transparent, locked, webShifted, shifted (by colorTable.shifted; also locked), webSafe}] (gif/png8: the colour table in file order), mappedToTransparent?: [\"#rrggbb\"…], slices: images an export writes, warnings (as document.exportForWeb's), dataBase64?}",
|
||||
has_doc,
|
||||
preview
|
||||
),
|
||||
@@ -331,8 +331,14 @@ pub struct ColorTable {
|
||||
/// A fixed palette (a Custom table) used instead of the reduction's own: the colors of the
|
||||
/// table when the first color was deleted. Empty: the reduction makes the palette.
|
||||
pub custom_palette: Vec<String>,
|
||||
/// Colors shifted by hand: each source color (`#rrggbb`) and the color it is written as. A
|
||||
/// shifted color is locked, and a source the table does not hold shifts nothing.
|
||||
pub shifted: std::collections::BTreeMap<String, String>,
|
||||
}
|
||||
|
||||
/// A color shifted by hand: (source, color written).
|
||||
type Shift = ([u8; 3], [u8; 3]);
|
||||
|
||||
/// The most colours a colour table list holds.
|
||||
const MAX_TABLE: usize = 256;
|
||||
|
||||
@@ -352,6 +358,21 @@ impl ColorTable {
|
||||
list.iter().map(|h| Self::rgb(h).ok_or_else(|| format!("colorTable.{what}: `{h}` is not a colour such as \"#ff8800\""))).collect()
|
||||
}
|
||||
|
||||
/// The colors shifted by hand as (source, color written). An error names a value that is not a
|
||||
/// color such as `#ff8800`, two keys that name one color, or more than 256 entries.
|
||||
fn shifts(&self) -> std::result::Result<Vec<Shift>, String> {
|
||||
// One entry past the limit is enough for `colors` to refuse a longer map.
|
||||
let (keys, values): (Vec<String>, Vec<String>) = self.shifted.iter().take(MAX_TABLE + 1).map(|(k, v)| (k.clone(), v.clone())).unzip();
|
||||
let sources = Self::colors(&keys, "shifted")?;
|
||||
let to = Self::colors(&values, "shifted")?;
|
||||
for (i, (s, k)) in sources.iter().zip(&keys).enumerate() {
|
||||
if sources[..i].contains(s) {
|
||||
return Err(format!("colorTable.shifted: `{k}` names a color another key names"));
|
||||
}
|
||||
}
|
||||
Ok(sources.into_iter().zip(to).collect())
|
||||
}
|
||||
|
||||
/// `h` as RGB; `None` when it is not a color such as `#ff8800`.
|
||||
fn rgb(h: &str) -> Option<[u8; 3]> {
|
||||
vectorcraft_color::Color::from_hex(h).filter(|_| !super::hex_with_alpha(h)).map(|c| {
|
||||
@@ -487,13 +508,18 @@ impl WebSettings {
|
||||
{
|
||||
ColorTable::colors(list, what)?;
|
||||
}
|
||||
// A deleted color is no longer locked, transparent or web-shifted.
|
||||
// A deleted color is no longer locked, transparent, web-shifted or shifted.
|
||||
let deleted = ColorTable::colors(&table.deleted, "deleted")?;
|
||||
if !deleted.is_empty() {
|
||||
for list in [&mut table.locked, &mut table.transparent, &mut table.web_shift] {
|
||||
list.retain(|h| ColorTable::rgb(h).is_none_or(|c| !deleted.contains(&c)));
|
||||
}
|
||||
}
|
||||
// Shifts are kept as `#rrggbb` in lowercase; a color shifted to itself is not shifted, and
|
||||
// a color shifted by hand is not web-shifted.
|
||||
let shifts: Vec<Shift> = table.shifts()?.into_iter().filter(|(s, to)| s != to && !deleted.contains(s)).collect();
|
||||
table.web_shift.retain(|h| ColorTable::rgb(h).is_none_or(|c| !shifts.iter().any(|(s, _)| *s == c)));
|
||||
table.shifted = shifts.into_iter().map(|(s, to)| (hex(s), hex(to))).collect();
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
@@ -640,6 +666,8 @@ pub struct TableColor {
|
||||
pub transparent: bool,
|
||||
pub locked: bool,
|
||||
pub web_shifted: bool,
|
||||
/// Shifted by hand (`colorTable.shifted`): written as `color` instead of `source`.
|
||||
pub shifted: bool,
|
||||
}
|
||||
|
||||
/// An optimised image file.
|
||||
@@ -759,6 +787,11 @@ fn palette_image(rgba: &[u8], w: u32, h: u32, s: &WebSettings, matte: Option<[u8
|
||||
let locked = ColorTable::colors(&table.locked, "locked")?;
|
||||
let to_clear = ColorTable::colors(&table.transparent, "transparent")?;
|
||||
let shift = ColorTable::colors(&table.web_shift, "webShift")?;
|
||||
let by_hand = table.shifts()?;
|
||||
let shifted_to = |src: &[u8; 3]| by_hand.iter().find(|(s, _)| s == src).map(|(_, to)| *to);
|
||||
// A color shifted by hand is kept when the colors are reduced, as a locked one is, and takes
|
||||
// one of the slots kept for them before the locked colors do.
|
||||
let kept: Vec<[u8; 3]> = by_hand.iter().map(|(s, _)| *s).chain(locked.iter().copied()).collect();
|
||||
let o = PaletteOptions {
|
||||
colors: s.colors,
|
||||
reduction: s.reduction,
|
||||
@@ -767,7 +800,7 @@ fn palette_image(rgba: &[u8], w: u32, h: u32, s: &WebSettings, matte: Option<[u8
|
||||
transparency: s.transparency,
|
||||
matte,
|
||||
};
|
||||
let mut ix = reduced(rgba, w, h, s, &o, &locked)?;
|
||||
let mut ix = reduced(rgba, w, h, s, &o, &kept)?;
|
||||
// Map to transparent works on the colours the reduction made.
|
||||
let before = ix.palette.clone();
|
||||
let clear = ix.transparent.map(usize::from);
|
||||
@@ -781,11 +814,11 @@ fn palette_image(rgba: &[u8], w: u32, h: u32, s: &WebSettings, matte: Option<[u8
|
||||
*slot = *c;
|
||||
}
|
||||
}
|
||||
// Web snap, then the colours shifted by hand (locked colours stay as they are).
|
||||
// Web shift and web snap (locked colors and colors shifted by hand stay as they are).
|
||||
let clear = ix.transparent.map(usize::from);
|
||||
for (i, c) in ix.palette.iter_mut().enumerate() {
|
||||
let src = sources.get(i).copied().unwrap_or(*c);
|
||||
if Some(i) == clear || locked.contains(&src) {
|
||||
if Some(i) == clear || shifted_to(&src).is_some() || locked.contains(&src) {
|
||||
continue;
|
||||
}
|
||||
if shift.contains(&src) {
|
||||
@@ -794,8 +827,19 @@ fn palette_image(rgba: &[u8], w: u32, h: u32, s: &WebSettings, matte: Option<[u8
|
||||
*c = snapped;
|
||||
}
|
||||
}
|
||||
// Lossy compares the pixels with the colors written for them, and moves no pixel into or out of
|
||||
// a color shifted by hand.
|
||||
if s.format == WebFormat::Gif {
|
||||
web::lossy(&mut ix, rgba, s.lossy);
|
||||
let fixed: Vec<u8> = sources.iter().enumerate().filter(|(_, c)| shifted_to(c).is_some()).filter_map(|(i, _)| u8::try_from(i).ok()).collect();
|
||||
web::lossy(&mut ix, rgba, s.lossy, &fixed);
|
||||
}
|
||||
// The colors shifted by hand.
|
||||
for (i, c) in ix.palette.iter_mut().enumerate() {
|
||||
if Some(i) != clear
|
||||
&& let Some(to) = sources.get(i).and_then(shifted_to)
|
||||
{
|
||||
*c = to;
|
||||
}
|
||||
}
|
||||
let order = web::sort(&mut ix, table.sort);
|
||||
let sources: Vec<[u8; 3]> = order.iter().map(|&i| sources.get(i).copied().unwrap_or_default()).collect();
|
||||
@@ -804,12 +848,17 @@ fn palette_image(rgba: &[u8], w: u32, h: u32, s: &WebSettings, matte: Option<[u8
|
||||
.iter()
|
||||
.zip(&sources)
|
||||
.enumerate()
|
||||
.map(|(i, (c, src))| TableColor {
|
||||
color: *c,
|
||||
source: *src,
|
||||
transparent: ix.transparent == u8::try_from(i).ok(),
|
||||
locked: locked.contains(src),
|
||||
web_shifted: shift.contains(src),
|
||||
.map(|(i, (c, src))| {
|
||||
let transparent = ix.transparent == u8::try_from(i).ok();
|
||||
let shifted = !transparent && shifted_to(src).is_some();
|
||||
TableColor {
|
||||
color: *c,
|
||||
source: *src,
|
||||
transparent,
|
||||
locked: locked.contains(src) || shifted,
|
||||
web_shifted: shift.contains(src) && !shifted,
|
||||
shifted,
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
Ok(PaletteImage { ix, colors, mapped })
|
||||
@@ -818,7 +867,8 @@ fn palette_image(rgba: &[u8], w: u32, h: u32, s: &WebSettings, matte: Option<[u8
|
||||
/// The pixels reduced to the palette `s` gives: the reduction's own (`locked` kept), or the
|
||||
/// color table's fixed one, without the deleted colors. The pixels of a deleted color take the
|
||||
/// nearest color left, with `o`'s dither. A deletion has to leave a color that is not mapped to
|
||||
/// transparent.
|
||||
/// transparent. A fixed palette keeps its colors mapped to transparent, which take one slot of
|
||||
/// `colors` together, and its first opaque colors that fit in the rest.
|
||||
fn reduced(rgba: &[u8], w: u32, h: u32, s: &WebSettings, o: &PaletteOptions, locked: &[[u8; 3]]) -> std::result::Result<Indexed, String> {
|
||||
let table = &s.color_table;
|
||||
let deleted = ColorTable::colors(&table.deleted, "deleted")?;
|
||||
@@ -847,11 +897,70 @@ fn reduced(rgba: &[u8], w: u32, h: u32, s: &WebSettings, o: &PaletteOptions, loc
|
||||
left.push(c);
|
||||
}
|
||||
}
|
||||
left.truncate(usize::from(s.colors.clamp(2, 256)) - usize::from(has_clear));
|
||||
if left.is_empty() || (removed && !opaque_left(&left)) {
|
||||
return Err(KEEP_ONE.into());
|
||||
}
|
||||
Ok(quantize::quantize_to(rgba, w, h, o, &left))
|
||||
// The colors mapped to transparent all become the one transparent entry, so together they take
|
||||
// one slot, and the opaque colors fill the rest in palette order. When no pixel takes one of
|
||||
// them and no pixel is transparent, that slot goes to the next opaque color instead.
|
||||
let kept = fixed_palette(&left, &to_clear, s.colors, has_clear, true);
|
||||
let mut ix = quantize::quantize_to(rgba, w, h, o, &kept);
|
||||
clear_dropped(&mut ix, rgba, o, &kept, &left, &to_clear);
|
||||
if !has_clear && !ix.palette.iter().any(|c| to_clear.contains(c)) && left.iter().any(|c| to_clear.contains(c)) {
|
||||
return Ok(quantize::quantize_to(rgba, w, h, o, &fixed_palette(&left, &to_clear, s.colors, has_clear, false)));
|
||||
}
|
||||
Ok(ix)
|
||||
}
|
||||
|
||||
/// The entries of the fixed palette `left` that fit in `colors`. With `clear`, the colors in
|
||||
/// `to_clear` are kept and take one slot together; without it they are left out. The list holds
|
||||
/// at most 256 entries, less one when `has_clear` (the transparent pixels' entry).
|
||||
fn fixed_palette(left: &[[u8; 3]], to_clear: &[[u8; 3]], colors: u16, has_clear: bool, clear: bool) -> Vec<[u8; 3]> {
|
||||
let any_clear = clear && left.iter().any(|c| to_clear.contains(c));
|
||||
let total = 256 - usize::from(has_clear);
|
||||
let mut room = (usize::from(colors.clamp(2, 256)) - usize::from(has_clear || any_clear)).min(total - usize::from(any_clear));
|
||||
let opaque = left.iter().filter(|c| !to_clear.contains(c)).count().min(room);
|
||||
let mut clear_room = if clear { total - opaque } else { 0 };
|
||||
left.iter()
|
||||
.copied()
|
||||
.filter(|c| {
|
||||
let slots = if to_clear.contains(c) { &mut clear_room } else { &mut room };
|
||||
let keep = *slots > 0;
|
||||
*slots = slots.saturating_sub(1);
|
||||
keep
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Makes transparent the pixels of `ix` whose nearest color is a color of `left` mapped to
|
||||
/// transparent (`to_clear`) that does not fit in the fixed palette `kept`. Such a pixel takes the
|
||||
/// transparent entry, or an entry mapped to transparent, which Map to Transparent clears later.
|
||||
fn clear_dropped(ix: &mut Indexed, rgba: &[u8], o: &PaletteOptions, kept: &[[u8; 3]], left: &[[u8; 3]], to_clear: &[[u8; 3]]) {
|
||||
let dropped: Vec<[u8; 3]> = left.iter().filter(|c| to_clear.contains(c) && !kept.contains(c)).copied().collect();
|
||||
if dropped.is_empty() {
|
||||
return;
|
||||
}
|
||||
let all: Vec<[u8; 3]> = kept.iter().chain(&dropped).copied().collect();
|
||||
let near = quantize::nearest_entries(rgba, o, &all);
|
||||
if !near.iter().any(|n| n.is_some_and(|n| n >= kept.len())) {
|
||||
return;
|
||||
}
|
||||
let entry = match ix.transparent.or_else(|| ix.palette.iter().position(|c| to_clear.contains(c)).and_then(|i| u8::try_from(i).ok())) {
|
||||
Some(i) => i,
|
||||
None => {
|
||||
// A kept color mapped to transparent that no pixel took; at most 255 entries are used then.
|
||||
let (Some(c), Ok(i)) = (kept.iter().find(|c| to_clear.contains(c)), u8::try_from(ix.palette.len())) else {
|
||||
return;
|
||||
};
|
||||
ix.palette.push(*c);
|
||||
i
|
||||
}
|
||||
};
|
||||
for (v, n) in ix.indices.iter_mut().zip(&near) {
|
||||
if n.is_some_and(|n| n >= kept.len()) {
|
||||
*v = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An optimised image as straight RGBA → `(pixels, width, height)` (the dialog's preview).
|
||||
@@ -1116,7 +1225,7 @@ fn preview(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
.map(|c| {
|
||||
json!({
|
||||
"color": hex(c.color), "source": hex(c.source), "transparent": c.transparent, "locked": c.locked,
|
||||
"webShifted": c.web_shifted, "webSafe": quantize::web_safe(c.color) == c.color,
|
||||
"webShifted": c.web_shifted, "shifted": c.shifted, "webSafe": quantize::web_safe(c.color) == c.color,
|
||||
})
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
//! Attribute uniqueness checks missing from the pinned shared XML reader's strict mode.
|
||||
//!
|
||||
//! Temporary consumer guard: parsing remains in craft-xml. Move this invariant into the
|
||||
//! shared strict reader and remove this second event pass when that dependency is updated.
|
||||
|
||||
/// Check names before canonical/local-name rewriting can collapse distinct attributes.
|
||||
/// The event reader and namespace scope use the same caller-supplied resource caps.
|
||||
pub(super) fn validate(xml: &[u8], limits: craft_xml::Limits) -> Result<(), String> {
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
let opts = craft_xml::Options { limits, doctype: craft_xml::Doctype::Reject, ..Default::default() }.strict();
|
||||
let mut events = opts.events(xml);
|
||||
let mut bindings: Vec<(String, String)> = Vec::new();
|
||||
let mut scopes = Vec::new();
|
||||
while let Some(event) = events.next().map_err(|e| e.to_string())? {
|
||||
match event {
|
||||
craft_xml::Event::Start { attrs, .. } => {
|
||||
scopes.push(bindings.len());
|
||||
let mut raw = BTreeSet::new();
|
||||
for (key, value) in &attrs {
|
||||
if !raw.insert(key.as_str()) {
|
||||
return Err(format!("duplicate attribute `{key}`"));
|
||||
}
|
||||
if let Some(prefix) = key.strip_prefix("xmlns:") {
|
||||
if bindings.len() >= limits.max_attrs {
|
||||
return Err("too many in-scope namespace declarations".into());
|
||||
}
|
||||
bindings.push((prefix.to_string(), value.clone()));
|
||||
}
|
||||
}
|
||||
let mut expanded = BTreeSet::new();
|
||||
for (key, _) in &attrs {
|
||||
if key == "xmlns" || key.starts_with("xmlns:") {
|
||||
continue;
|
||||
}
|
||||
// Default namespaces do not apply to attributes. Preserve undeclared
|
||||
// prefixes for standalone SVG library fragments, as the importer did.
|
||||
let name = match key.split_once(':') {
|
||||
Some(("xml", local)) => ("http://www.w3.org/XML/1998/namespace", local),
|
||||
Some((prefix, local)) => {
|
||||
bindings.iter().rev().find(|(p, _)| p == prefix).map_or(("", key.as_str()), |(_, uri)| (uri.as_str(), local))
|
||||
}
|
||||
None => ("", key.as_str()),
|
||||
};
|
||||
if !expanded.insert(name) {
|
||||
return Err(format!("duplicate expanded attribute `{key}`"));
|
||||
}
|
||||
}
|
||||
}
|
||||
craft_xml::Event::End { .. } => bindings.truncate(scopes.pop().unwrap_or(0)),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -110,6 +110,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
"art-ribbons",
|
||||
"ink-and-wash",
|
||||
"calligraphic-nibs",
|
||||
"pressure-sensitive",
|
||||
"bristle-brushes",
|
||||
"pattern-borders",
|
||||
"scatter-shapes",
|
||||
@@ -131,19 +132,19 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
trails["brushes"].as_array().unwrap().iter().map(|b| b["name"].as_str().unwrap()).collect::<Vec<_>>(),
|
||||
["Speed Line", "Dash Trail", "Burst Ray", "Zigzag"]
|
||||
);
|
||||
assert_eq!(libs[6]["count"].as_u64(), Some(4));
|
||||
assert_eq!(libs[7]["count"].as_u64(), Some(4));
|
||||
let beams = run(&mut s, "brush.library", json!({"library": "energy-beams"}));
|
||||
assert_eq!(
|
||||
beams["brushes"].as_array().unwrap().iter().map(|b| b["name"].as_str().unwrap()).collect::<Vec<_>>(),
|
||||
["Laser Bolt", "Plasma Arc", "Charge Wave", "Spark Trail"]
|
||||
);
|
||||
assert_eq!(libs[7]["count"].as_u64(), Some(4));
|
||||
assert_eq!(libs[8]["count"].as_u64(), Some(4));
|
||||
let dry = run(&mut s, "brush.library", json!({"library": "Dry Media"}));
|
||||
assert_eq!(
|
||||
dry["brushes"].as_array().unwrap().iter().map(|b| (b["name"].as_str().unwrap(), b["type"].as_str().unwrap())).collect::<Vec<_>>(),
|
||||
[("Chalk Grain", "art"), ("Graphite Pencil", "art"), ("Wax Crayon", "art"), ("Charcoal Dust", "art")]
|
||||
);
|
||||
assert_eq!((libs[8]["name"].as_str(), libs[8]["count"].as_u64()), (Some("Dry Media"), Some(4)));
|
||||
assert_eq!((libs[9]["name"].as_str(), libs[9]["count"].as_u64()), (Some("Dry Media"), Some(4)));
|
||||
run(&mut s, "file.new", json!({"width": 200, "height": 200}));
|
||||
let id = run(&mut s, "shape.rectangle", json!({"x": 10, "y": 20, "width": 40, "height": 8}))["id"].as_u64().unwrap();
|
||||
let added = run(&mut s, "brush.addFromLibrary", json!({"library": "energy-beams", "name": "Laser Bolt", "apply": true, "ids": [id]}));
|
||||
@@ -154,6 +155,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
("art-ribbons", "art"),
|
||||
("ink-and-wash", "art"),
|
||||
("calligraphic-nibs", "calligraphic"),
|
||||
("pressure-sensitive", "art"),
|
||||
("bristle-brushes", "bristle"),
|
||||
("pattern-borders", "pattern"),
|
||||
("scatter-shapes", "scatter"),
|
||||
@@ -164,7 +166,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
let (_, lib) = cmd::brushlib::library(&s, id).unwrap();
|
||||
assert!(lib.len() >= 4, "{id}");
|
||||
for b in &lib.brushes {
|
||||
let kind = if b.name == "Brush Pen" { "calligraphic" } else { kind };
|
||||
let kind = if ["Brush Pen", "Round Flow", "Chisel Flow"].contains(&b.name.as_str()) { "calligraphic" } else { kind };
|
||||
assert_eq!(b.kind.type_id(), kind, "{}", b.name);
|
||||
let mut line = vectorcraft_geom::BezPath::new();
|
||||
line.move_to((0.0, 0.0));
|
||||
@@ -299,6 +301,52 @@ fn the_tech_circuit_library_constructs_adds_and_applies_each_brush() {
|
||||
assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pressure_sensitive_brushes_widen_with_pen_pressure_and_survive_a_saved_library() {
|
||||
let mut s = session();
|
||||
let (_, lib) = cmd::brushlib::library(&s, "Pressure Sensitive").unwrap();
|
||||
let names = ["Flex Ribbon", "Pulse Stroke", "Round Flow", "Chisel Flow"];
|
||||
assert_eq!(lib.brushes.iter().map(|b| b.name.as_str()).collect::<Vec<_>>(), names);
|
||||
let path = run(&mut s, "shape.line", json!({"x1": 10, "y1": 40, "x2": 190, "y2": 40}))["id"].as_u64().unwrap();
|
||||
let mut curve = line_to(20.0);
|
||||
curve.curve_to((60.0, -25.0), (140.0, 25.0), (180.0, 0.0));
|
||||
for b in &lib.brushes {
|
||||
let width_at = |pressure| {
|
||||
let stroke = vectorcraft_doc::StrokeLayer {
|
||||
pressure: Some(vectorcraft_doc::PressureProfile { points: vec![(0.0, pressure), (1.0, pressure)] }),
|
||||
..black_stroke()
|
||||
};
|
||||
let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line_to(180.0), &stroke);
|
||||
let points = anchors(&pieces.iter().collect::<Vec<_>>());
|
||||
assert!(!points.is_empty() && points.iter().all(|p| p.x.is_finite() && p.y.is_finite()), "{} at pressure {pressure}", b.name);
|
||||
let min = points.iter().map(|p| p.y).fold(f64::INFINITY, f64::min);
|
||||
let max = points.iter().map(|p| p.y).fold(f64::NEG_INFINITY, f64::max);
|
||||
max - min
|
||||
};
|
||||
let light = width_at(0.0);
|
||||
let heavy = width_at(1.0);
|
||||
for width in [light, heavy] {
|
||||
assert!(width.is_finite() && width > 0.0, "{}: light={light}, heavy={heavy}", b.name);
|
||||
}
|
||||
assert!(heavy > light * 1.3, "{}: light={light}, heavy={heavy}", b.name);
|
||||
for line in [line_to(2.0), curve.clone()] {
|
||||
let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line, &black_stroke());
|
||||
let points = anchors(&pieces.iter().collect::<Vec<_>>());
|
||||
assert!(!points.is_empty() && points.iter().all(|p| p.x.is_finite() && p.y.is_finite()), "{}", b.name);
|
||||
}
|
||||
let before = undo_len(&s);
|
||||
let added = run(&mut s, "brush.addFromLibrary", json!({"library": "pressure-sensitive", "name": b.name, "apply": true, "ids": [path]}));
|
||||
assert_eq!(strs(&added["added"]), [b.name.as_str()]);
|
||||
assert_eq!(added["applied"], json!([path]));
|
||||
assert_eq!(undo_len(&s), before + 1);
|
||||
assert_eq!(doc(&s).node(NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(), Some(b.name.as_str()));
|
||||
}
|
||||
let saved = run(&mut s, "brush.saveLibrary", json!({"names": names}));
|
||||
let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap();
|
||||
let reopened = vectorcraft_format::load(&bytes).unwrap();
|
||||
assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes);
|
||||
}
|
||||
|
||||
/// Ink and Wash: a tapered ink art brush, a brush pen whose size follows the pen pressure and two
|
||||
/// translucent washes, with names of their own and a few paths of art each.
|
||||
#[test]
|
||||
|
||||
@@ -407,7 +407,7 @@ fn image_with_shaped_fill(s: &mut Session) -> NodeId {
|
||||
/// outline with `outline`.
|
||||
fn marquee_at(s: &Session, x0: f64, x1: f64, outline: bool) -> Vec<NodeId> {
|
||||
let r = vectorcraft_geom::Rect::new(x0, 90.0, x1, 110.0);
|
||||
vectorcraft_doc::hit::marquee_in_view(&s.doc().unwrap().doc, r, None, true, outline)
|
||||
vectorcraft_doc::hit::marquee_in_view(&s.doc().unwrap().doc, r, None, true, outline, false)
|
||||
}
|
||||
|
||||
/// A marquee touches a symbol instance where the geometry effects of its fill or stroke paint its
|
||||
|
||||
@@ -539,6 +539,196 @@ fn colour_table_delete_maps_pixels_to_the_nearest_color_left() {
|
||||
assert_eq!(sources(&preview(&mut s, json!({"preset": "No near red"}))), ["#0000ff", "#ff0000"]);
|
||||
}
|
||||
|
||||
/// The colors of a fixed palette mapped to transparent take one slot of Colors together with the
|
||||
/// transparent pixels, so the opaque colors after them still fit: their pixels stay opaque, and the
|
||||
/// pixels of the colors mapped to transparent become transparent.
|
||||
#[test]
|
||||
fn colour_table_fixed_palette_keeps_an_opaque_color() {
|
||||
// 40×10: red, a near red and blue, and 10 px with nothing (transparent).
|
||||
let mut s = session(40.0, 10.0);
|
||||
rect(&mut s, [0.0, 0.0, 10.0, 10.0], "#ff0000");
|
||||
rect(&mut s, [10.0, 0.0, 10.0, 10.0], "#ee1100");
|
||||
rect(&mut s, [20.0, 0.0, 10.0, 10.0], "#0000ff");
|
||||
for table in [
|
||||
json!({"customPalette": ["#ff0000", "#ee1100", "#0000ff"], "deleted": ["#ee1100"], "transparent": ["#ff0000"]}),
|
||||
json!({"customPalette": ["#ff0000", "#0000ff"], "transparent": ["#ff0000"]}),
|
||||
] {
|
||||
let p = json!({"format": "png8", "dither": "none", "colors": 2, "colorTable": table});
|
||||
let v = run(&mut s, "document.exportForWeb.preview", p.clone());
|
||||
let opaque: Vec<&Value> = v["colors"].as_array().unwrap().iter().filter(|c| c["transparent"] == false).map(|c| &c["source"]).collect();
|
||||
assert_eq!((opaque, v["colors"].as_array().unwrap().len()), (vec![&json!("#0000ff")], 2), "{p}");
|
||||
let img = pixels(&one(&mut s, p.clone()));
|
||||
let alpha = |x: u32| img.get_pixel(x, 5).0[3];
|
||||
assert_eq!((alpha(5), alpha(15), img.get_pixel(25, 5).0, alpha(35)), (0, 0, [0, 0, 255, 255], 0), "{p}");
|
||||
}
|
||||
// A color mapped to transparent that no pixel takes leaves its slot to an opaque color.
|
||||
let mut u = session(20.0, 10.0);
|
||||
rect(&mut u, [0.0, 0.0, 10.0, 10.0], "#0000ff");
|
||||
rect(&mut u, [10.0, 0.0, 10.0, 10.0], "#00ff00");
|
||||
let p = json!({"format": "png8", "dither": "none", "colors": 2, "colorTable": {"customPalette": ["#0000ff", "#00ff00", "#ff0000"], "transparent": ["#ff0000"]}});
|
||||
let img = pixels(&one(&mut u, p));
|
||||
assert_eq!((img.get_pixel(5, 5).0, img.get_pixel(15, 5).0), ([0, 0, 255, 255], [0, 255, 0, 255]));
|
||||
// At 256 colors a color mapped to transparent after 255 opaque ones still keeps an entry.
|
||||
let full: Vec<String> =
|
||||
std::iter::once("#0000ff".to_string()).chain((1..255).map(|i| format!("#00{i:02x}00"))).chain(["#ff0000".to_string()]).collect();
|
||||
let p = json!({"format": "png8", "dither": "none", "colors": 256, "colorTable": {"customPalette": full, "transparent": ["#ff0000"]}});
|
||||
let img = pixels(&one(&mut s, p));
|
||||
assert_eq!((img.get_pixel(5, 5).0[3], img.get_pixel(25, 5).0, img.get_pixel(35, 5).0[3]), (0, [0, 0, 255, 255], 0));
|
||||
// With one opaque color and 255 mapped to transparent, the last of those does not fit, and its
|
||||
// pixels still become transparent rather than taking the opaque color nearest them.
|
||||
let mut d = session(30.0, 10.0);
|
||||
rect(&mut d, [0.0, 0.0, 10.0, 10.0], "#0000ff");
|
||||
rect(&mut d, [10.0, 0.0, 10.0, 10.0], "#0000ee");
|
||||
let clear: Vec<String> = (1..255).map(|i| format!("#00{i:02x}00")).chain(["#0000ee".to_string()]).collect();
|
||||
let palette: Vec<String> = std::iter::once("#0000ff".to_string()).chain(clear.iter().cloned()).collect();
|
||||
let p = json!({"format": "png8", "dither": "none", "colors": 256, "colorTable": {"customPalette": palette, "transparent": clear}});
|
||||
let img = pixels(&one(&mut d, p));
|
||||
assert_eq!((img.get_pixel(5, 5).0, img.get_pixel(15, 5).0[3], img.get_pixel(25, 5).0[3]), ([0, 0, 255, 255], 0, 0));
|
||||
// Without transparent pixels the colors mapped to transparent still take one slot together.
|
||||
let mut t = session(30.0, 10.0);
|
||||
rect(&mut t, [0.0, 0.0, 10.0, 10.0], "#ff0000");
|
||||
rect(&mut t, [10.0, 0.0, 10.0, 10.0], "#ee1100");
|
||||
rect(&mut t, [20.0, 0.0, 10.0, 10.0], "#0000ff");
|
||||
let p = json!({"format": "png8", "dither": "none", "colors": 2, "colorTable": {
|
||||
"customPalette": ["#ff0000", "#ee1100", "#0000ff", "#00ff00"], "transparent": ["#ff0000", "#ee1100"],
|
||||
}});
|
||||
let v = run(&mut t, "document.exportForWeb.preview", p.clone());
|
||||
assert_eq!(v["colors"].as_array().unwrap().len(), 2, "{v}");
|
||||
let img = pixels(&one(&mut t, p));
|
||||
assert_eq!((img.get_pixel(5, 5).0[3], img.get_pixel(15, 5).0[3], img.get_pixel(25, 5).0), (0, 0, [0, 0, 255, 255]));
|
||||
}
|
||||
|
||||
/// A color shifted by hand (`colorTable.shifted`) is written as the color picked wherever it is in
|
||||
/// the image, the other colors stay, the table shows it as shifted and locked, and the preview is
|
||||
/// the file.
|
||||
#[test]
|
||||
fn colour_table_shift_writes_the_picked_color_wherever_the_source_is() {
|
||||
let mut s = session(30.0, 10.0);
|
||||
rect(&mut s, [0.0, 0.0, 10.0, 10.0], "#ff0000");
|
||||
rect(&mut s, [10.0, 0.0, 10.0, 10.0], "#0000ff");
|
||||
rect(&mut s, [20.0, 0.0, 10.0, 10.0], "#00ff00");
|
||||
let preview = |s: &mut Session, p: Value| run(s, "document.exportForWeb.preview", p);
|
||||
let entry = |v: &Value, source: &str| v["colors"].as_array().unwrap().iter().find(|c| c["source"] == source).cloned().unwrap_or(Value::Null);
|
||||
for format in ["gif", "png8"] {
|
||||
let p = json!({"format": format, "dither": "none", "colorTable": {"shifted": {"#0000FF": "#FF8800"}}});
|
||||
let v = preview(&mut s, p.clone());
|
||||
let c = entry(&v, "#0000ff");
|
||||
assert_eq!(
|
||||
(c["color"].as_str(), c["shifted"].as_bool(), c["locked"].as_bool(), c["webShifted"].as_bool()),
|
||||
(Some("#ff8800"), Some(true), Some(true), Some(false)),
|
||||
"{format}: {v}"
|
||||
);
|
||||
assert_eq!((entry(&v, "#ff0000")["shifted"].as_bool(), entry(&v, "#ff0000")["color"].as_str()), (Some(false), Some("#ff0000")));
|
||||
let file = one(&mut s, p);
|
||||
assert_eq!(v["bytes"].as_u64(), Some(file.len() as u64), "{format}: the preview is the file");
|
||||
let img = pixels(&file);
|
||||
assert_eq!(
|
||||
(img.get_pixel(5, 5).0, img.get_pixel(12, 2).0, img.get_pixel(18, 8).0, img.get_pixel(25, 5).0),
|
||||
([255, 0, 0, 255], [255, 136, 0, 255], [255, 136, 0, 255], [0, 255, 0, 255]),
|
||||
"{format}"
|
||||
);
|
||||
assert_eq!(distinct(&img), 3, "{format}");
|
||||
}
|
||||
// A shifted color is kept when the colors are reduced, as a locked one is.
|
||||
let two = preview(&mut s, json!({"colors": 2, "dither": "none", "colorTable": {"shifted": {"#00ff00": "#123456"}}}));
|
||||
assert_eq!(entry(&two, "#00ff00")["color"], "#123456", "{two}");
|
||||
// With one slot to keep, the shifted color takes it before a locked one.
|
||||
let p = json!({"colors": 2, "dither": "none", "colorTable": {"locked": ["#ff0000"], "shifted": {"#0000ff": "#123456"}}});
|
||||
let first = preview(&mut s, p);
|
||||
assert_eq!(entry(&first, "#0000ff")["color"], "#123456", "{first}");
|
||||
// A source the table does not hold shifts nothing, and the shift stays with the settings.
|
||||
let base = preview(&mut s, json!({"dither": "none"}));
|
||||
let absent = preview(&mut s, json!({"dither": "none", "colorTable": {"shifted": {"#123456": "#000000"}}}));
|
||||
assert_eq!(absent["colors"], base["colors"]);
|
||||
// Two colors may be shifted to one color and keep their own sources.
|
||||
let same = preview(&mut s, json!({"dither": "none", "colorTable": {"shifted": {"#ff0000": "#123456", "#0000ff": "#123456"}}}));
|
||||
assert_eq!((entry(&same, "#ff0000")["color"].as_str(), entry(&same, "#0000ff")["color"].as_str()), (Some("#123456"), Some("#123456")));
|
||||
assert_eq!(entry(&same, "#00ff00")["shifted"], false);
|
||||
// A shift by hand wins over web shift, web snap and a lock; transparency wins over it.
|
||||
let p =
|
||||
json!({"dither": "none", "webSnap": 100, "colorTable": {"shifted": {"#0000ff": "#fe0101"}, "webShift": ["#0000ff"], "locked": ["#0000ff"]}});
|
||||
let c = entry(&preview(&mut s, p), "#0000ff");
|
||||
assert_eq!((c["color"].as_str(), c["webShifted"].as_bool(), c["locked"].as_bool()), (Some("#fe0101"), Some(false), Some(true)));
|
||||
let clear = json!({"dither": "none", "colorTable": {"shifted": {"#0000ff": "#fe0101"}, "transparent": ["#0000ff"]}});
|
||||
let v = preview(&mut s, clear.clone());
|
||||
assert!(v["colors"].as_array().unwrap().iter().all(|c| c["shifted"] == false), "{v}");
|
||||
assert_eq!(pixels(&one(&mut s, clear)).get_pixel(15, 5).0[3], 0);
|
||||
// The settings keep the shifts in lowercase, drop a color shifted to itself, a deleted one and
|
||||
// the web shift of a color shifted by hand.
|
||||
let table = json!({"shifted": {"#0000FF": "#FE0101", "#FF0000": "#ff0000", "#00ff00": "#000000"}, "webShift": ["#0000ff", "#00ff00"], "deleted": ["#00ff00"]});
|
||||
let r = run(&mut s, "webExport.settings", json!({ "colorTable": table }));
|
||||
let t = &r["settings"]["colorTable"];
|
||||
assert_eq!((&t["shifted"], &t["webShift"]), (&json!({"#0000ff": "#fe0101"}), &json!([])));
|
||||
// Another reduction keeps the shifts; a saved preset keeps them.
|
||||
let r = run(&mut s, "webExport.settings", json!({"reduction": "adaptive"}));
|
||||
assert_eq!(r["settings"]["colorTable"]["shifted"], json!({"#0000ff": "#fe0101"}));
|
||||
run(&mut s, "webExport.presets.save", json!({"name": "Blue to red", "dither": "none", "colorTable": {"shifted": {"#0000ff": "#fe0101"}}}));
|
||||
assert_eq!(entry(&preview(&mut s, json!({"preset": "Blue to red"})), "#0000ff")["color"], "#fe0101");
|
||||
// Bad shifts are refused and change nothing.
|
||||
let many: serde_json::Map<String, Value> = (0..257).map(|i| (format!("#{i:06x}"), json!("#000000"))).collect();
|
||||
for bad in [
|
||||
json!({"nope": "#000000"}),
|
||||
json!({"#ff0000": "nope"}),
|
||||
json!({"#ff0000": "#ff000080"}),
|
||||
json!({"#ff000080": "#000000"}),
|
||||
json!({"#ff0000": "#000000", "#FF0000": "#ffffff"}),
|
||||
json!({"#f00": "#000000", "#ff0000": "#ffffff"}),
|
||||
Value::Object(many),
|
||||
] {
|
||||
let p = json!({"colorTable": {"shifted": bad}});
|
||||
assert!(s.execute("document.exportForWeb", &p).is_err(), "{p}");
|
||||
assert!(s.execute("document.exportForWeb.preview", &p).is_err(), "{p}");
|
||||
assert!(s.execute("webExport.settings", &p).is_err(), "{p}");
|
||||
}
|
||||
assert_eq!(run(&mut s, "webExport.settings", json!({}))["settings"]["colorTable"]["shifted"], json!({"#0000ff": "#fe0101"}));
|
||||
// Settings saved before shifts existed still read.
|
||||
let old: cmd::webexport::WebSettings = serde_json::from_value(json!({"colorTable": {"locked": ["#ff0000"]}})).unwrap();
|
||||
assert!(old.color_table.shifted.is_empty());
|
||||
}
|
||||
|
||||
/// Lossy GIF compression leaves the pixels of a color shifted by hand alone, so a color shifted near
|
||||
/// another one does not take in that color's pixels.
|
||||
#[test]
|
||||
fn lossy_does_not_spread_a_shifted_color_into_another() {
|
||||
let mut s = session(30.0, 10.0);
|
||||
rect(&mut s, [0.0, 0.0, 10.0, 10.0], "#0000ff");
|
||||
rect(&mut s, [10.0, 0.0, 20.0, 10.0], "#c80000");
|
||||
let p = json!({"format": "gif", "dither": "none", "lossy": 100, "colorTable": {"shifted": {"#0000ff": "#be0000"}}});
|
||||
let img = pixels(&one(&mut s, p));
|
||||
assert_eq!((img.get_pixel(5, 5).0, img.get_pixel(20, 5).0, img.get_pixel(29, 5).0), ([190, 0, 0, 255], [200, 0, 0, 255], [200, 0, 0, 255]));
|
||||
}
|
||||
|
||||
/// Lossy GIF compression moves no pixel into or out of a color shifted by hand: the colors next to
|
||||
/// a shifted one keep their own pixels, and the shifted color keeps all of its pixels.
|
||||
#[test]
|
||||
fn lossy_moves_no_pixel_into_or_out_of_a_shifted_color() {
|
||||
let mut s = session(30.0, 10.0);
|
||||
rect(&mut s, [0.0, 0.0, 10.0, 10.0], "#1414e6");
|
||||
rect(&mut s, [10.0, 0.0, 20.0, 10.0], "#0000ff");
|
||||
rect(&mut s, [20.0, 0.0, 30.0, 10.0], "#1414e6");
|
||||
let p = json!({"format": "gif", "dither": "none", "lossy": 100, "colorTable": {"shifted": {"#0000ff": "#ff0000"}}});
|
||||
let img = pixels(&one(&mut s, p));
|
||||
let near_blue = [20, 20, 230, 255];
|
||||
for x in 0..30 {
|
||||
let want = if (10..20).contains(&x) { [255, 0, 0, 255] } else { near_blue };
|
||||
assert_eq!(img.get_pixel(x, 5).0, want, "x = {x}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Lossy GIF compression compares the pixels with the colors web snap writes, so a pixel does not
|
||||
/// take a color that snaps far from it.
|
||||
#[test]
|
||||
fn lossy_compares_pixels_with_the_snapped_colors() {
|
||||
let mut s = session(20.0, 10.0);
|
||||
rect(&mut s, [0.0, 0.0, 10.0, 10.0], "#1a1a1a");
|
||||
rect(&mut s, [10.0, 0.0, 20.0, 10.0], "#000000");
|
||||
let img = pixels(&one(&mut s, json!({"format": "gif", "dither": "none", "webSnap": 100, "lossy": 50})));
|
||||
for x in 0..20 {
|
||||
let want = if x < 10 { [51, 51, 51, 255] } else { [0, 0, 0, 255] };
|
||||
assert_eq!(img.get_pixel(x, 5).0, want, "x = {x}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn presets_and_remembered_settings() {
|
||||
let mut s = two_colours();
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
//! Blend edits invalidate every pixel they change, including keys aligned to a curved spine.
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use serde_json::json;
|
||||
use vectorcraft_doc::{Document, NodeId, NodeKind};
|
||||
use vectorcraft_engine::Session;
|
||||
use vectorcraft_geom::Affine;
|
||||
use vectorcraft_render::{Changed, RenderOptions, Rendered, Renderer, view_pixels};
|
||||
|
||||
const WIDTH: u32 = 720;
|
||||
const HEIGHT: u32 = 480;
|
||||
|
||||
type Retained = (Renderer, Option<(Arc<Document>, Vec<u8>)>);
|
||||
|
||||
fn live(s: &Session, blend: NodeId, keys: [NodeId; 2], curved: bool) {
|
||||
let doc = &s.doc().unwrap().doc;
|
||||
let NodeKind::Blend { children, spec } = &doc.node(blend).unwrap().kind else {
|
||||
panic!("INPUT: the fixture must remain a live blend");
|
||||
};
|
||||
assert_eq!(children.iter().map(|n| n.id).collect::<Vec<_>>(), keys.to_vec());
|
||||
assert_eq!(serde_json::to_value(spec).unwrap()["spacing"], json!({"steps": 3}));
|
||||
for key in keys {
|
||||
assert_eq!(doc.parent_of(key), Some(blend), "INPUT: key identity/parent changed");
|
||||
}
|
||||
if curved {
|
||||
let bounds = spec.spine.as_ref().expect("INPUT: Replace Spine did not set a spine").bounds().unwrap();
|
||||
assert!(!spec.no_spine && bounds.height() > 40.0 && bounds.width() > 250.0, "INPUT: a real curved spine is required");
|
||||
}
|
||||
}
|
||||
|
||||
fn fixture() -> (Session, NodeId, [NodeId; 2]) {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": WIDTH, "height": HEIGHT})).unwrap();
|
||||
let mut rectangle = |x: f64, color: &str| {
|
||||
let id = NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": 120.0, "width": 64.0, "height": 48.0})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("paint.setFill", &json!({"color": color})).unwrap();
|
||||
s.execute("paint.setStroke", &json!({"none": true})).unwrap();
|
||||
id
|
||||
};
|
||||
let keys = [rectangle(90.0, "#d52c38"), rectangle(430.0, "#25b453")];
|
||||
let blend = NodeId(
|
||||
s.execute("object.blend.make", &json!({"ids": [keys[0].0, keys[1].0], "steps": 3, "orientation": "path"})).unwrap()["id"].as_u64().unwrap(),
|
||||
);
|
||||
assert_eq!(s.doc().unwrap().selection.objects, vec![blend]);
|
||||
live(&s, blend, keys, false);
|
||||
(s, blend, keys)
|
||||
}
|
||||
|
||||
fn cpu() -> Renderer {
|
||||
let mut renderer = Renderer::new();
|
||||
renderer.threads = 0;
|
||||
renderer
|
||||
}
|
||||
|
||||
fn same_pixels(actual: &Rendered, expected: &Rendered) {
|
||||
assert_eq!((actual.width, actual.height), (WIDTH, HEIGHT));
|
||||
assert_eq!((expected.width, expected.height), (WIDTH, HEIGHT));
|
||||
assert_eq!(actual.pixels.len(), (WIDTH * HEIGHT * 4) as usize);
|
||||
assert!(actual.pixels == expected.pixels, "complete RGBA frames differ");
|
||||
}
|
||||
|
||||
fn damage_pixels(stage: &str, changed: Changed, before: &[u8], current: &[u8]) {
|
||||
let region = match changed {
|
||||
Changed::Everything => return,
|
||||
Changed::Nothing => None,
|
||||
Changed::Area(area) => view_pixels(area, Affine::IDENTITY, WIDTH, HEIGHT),
|
||||
};
|
||||
assert_eq!(before.len(), current.len());
|
||||
for (i, (old, new)) in before.as_chunks::<4>().0.iter().zip(current.as_chunks::<4>().0.iter()).enumerate() {
|
||||
let (x, y) = (i as u32 % WIDTH, i as u32 / WIDTH);
|
||||
if !region.is_some_and(|[x0, y0, x1, y1]| x >= x0 && x < x1 && y >= y0 && y < y1) {
|
||||
assert_eq!(old, new, "{stage}: pixel ({x}, {y}) changed outside {changed:?}, view pixels {region:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn frame(s: &Session, retained: &mut Retained, stage: &str) -> Rendered {
|
||||
let doc = &s.doc().unwrap().doc;
|
||||
let opts = RenderOptions { background: Some([255, 255, 255, 255]), artboards: false, ..Default::default() };
|
||||
// Ask for the edit's advertised damage before rendering the new full frame on this renderer.
|
||||
let changed = retained.1.as_ref().map(|(old, _)| retained.0.changed(old.as_ref(), doc.as_ref(), &opts));
|
||||
let actual = retained.0.render(doc.as_ref(), WIDTH, HEIGHT, Affine::IDENTITY, &opts);
|
||||
let expected = cpu().render(doc.as_ref(), WIDTH, HEIGHT, Affine::IDENTITY, &opts);
|
||||
same_pixels(&actual, &expected);
|
||||
let red = expected.pixels.as_chunks::<4>().0.iter().filter(|p| p[0] > 150 && p[1] < 100 && p[2] < 120 && p[3] == 255).count();
|
||||
let green = expected.pixels.as_chunks::<4>().0.iter().filter(|p| p[0] < 100 && p[1] > 120 && p[2] < 150 && p[3] == 255).count();
|
||||
assert!(red > 100 && green > 100, "INPUT: both original colored keys must really draw: red={red}, green={green}");
|
||||
if let (Some((_, previous)), Some(changed)) = (&retained.1, changed) {
|
||||
damage_pixels(stage, changed, previous, &expected.pixels);
|
||||
}
|
||||
retained.1 = Some((doc.clone(), expected.pixels));
|
||||
actual
|
||||
}
|
||||
|
||||
fn move_and_undo(s: &mut Session, retained: &mut Retained, blend: NodeId, keys: [NodeId; 2], curved: bool, before_frame: &Rendered) {
|
||||
assert_eq!(s.doc().unwrap().selection.objects, vec![blend]);
|
||||
let before = serde_json::to_value(s.doc().unwrap().doc.as_ref()).unwrap();
|
||||
s.execute("object.transform", &json!({"matrix": [1.0, 0.0, 0.0, 1.0, 37.0, 29.0]})).unwrap();
|
||||
live(s, blend, keys, curved);
|
||||
assert_eq!(s.doc().unwrap().selection.objects, vec![blend]);
|
||||
let moved = frame(s, retained, "moved");
|
||||
assert!(moved.pixels != before_frame.pixels, "INPUT: the fresh rendered fixture must actually move");
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
live(s, blend, keys, curved);
|
||||
assert_eq!(serde_json::to_value(s.doc().unwrap().doc.as_ref()).unwrap(), before);
|
||||
assert_eq!(s.doc().unwrap().selection.objects, vec![blend]);
|
||||
let restored = frame(s, retained, "undo-move");
|
||||
same_pixels(&restored, before_frame);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blend_5179_straight_move_undo_matches_fresh_cpu() {
|
||||
let (mut s, blend, keys) = fixture();
|
||||
let mut retained = (cpu(), None);
|
||||
let warm = frame(&s, &mut retained, "warm");
|
||||
move_and_undo(&mut s, &mut retained, blend, keys, false, &warm);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blend_5179_replace_spine_move_undo_matches_fresh_cpu() {
|
||||
let (mut s, blend, keys) = fixture();
|
||||
let path = NodeId(s.execute("path.create", &json!({"d": "M122 144 C166 330 402 288 462 144"})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("select.set", &json!({"ids": [blend.0, path.0]})).unwrap();
|
||||
let before = serde_json::to_value(s.doc().unwrap().doc.as_ref()).unwrap();
|
||||
let nodes = s.doc().unwrap().doc.node_count();
|
||||
let mut retained = (cpu(), None);
|
||||
let warm = frame(&s, &mut retained, "before-replace");
|
||||
s.execute("object.blend.replaceSpine", &json!({})).unwrap();
|
||||
live(&s, blend, keys, true);
|
||||
assert!(s.doc().unwrap().doc.node(path).is_none(), "Replace Spine consumes the original standalone path");
|
||||
assert_eq!(s.doc().unwrap().doc.node_count(), nodes - 1);
|
||||
assert_eq!(s.doc().unwrap().selection.objects, vec![blend]);
|
||||
let replaced = frame(&s, &mut retained, "replaced");
|
||||
assert!(replaced.pixels != warm.pixels, "INPUT: replacing the spine must visibly change the drawn fixture");
|
||||
move_and_undo(&mut s, &mut retained, blend, keys, true, &replaced);
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
live(&s, blend, keys, false);
|
||||
assert_eq!(serde_json::to_value(s.doc().unwrap().doc.as_ref()).unwrap(), before);
|
||||
let restored = frame(&s, &mut retained, "undo-replace");
|
||||
same_pixels(&restored, &warm);
|
||||
}
|
||||
|
||||
// A fixed ordinary anisotropic Transform, evaluated after Align to Path turns the key.
|
||||
// 200% is the legitimate control; 400% is the single source-derived witness.
|
||||
fn rotated_transform_damage(scale_h: f64) {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": WIDTH, "height": HEIGHT})).unwrap();
|
||||
let mut rectangle = |x: f64, color: &str| {
|
||||
let id = NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": 200.0, "width": 8.0, "height": 80.0})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("paint.setFill", &json!({"color": color})).unwrap();
|
||||
s.execute("paint.setStroke", &json!({"none": true})).unwrap();
|
||||
s.execute("effect.apply", &json!({"effect": "distort.transform", "params": {"scaleH": scale_h, "scaleV": 100.0, "reference": 4}})).unwrap();
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
let b = n.geometric_bounds().unwrap();
|
||||
assert!((b.width() - 8.0).abs() < 1e-8 && (b.height() - 80.0).abs() < 1e-8, "INPUT: the Transform must remain live on the narrow key");
|
||||
assert_eq!(n.appearance.effects.len(), 1);
|
||||
assert_eq!(n.appearance.effects[0].params["scaleH"], json!(scale_h));
|
||||
id
|
||||
};
|
||||
let keys = [rectangle(260.0, "#d52c38"), rectangle(460.0, "#25b453")];
|
||||
let blend = NodeId(
|
||||
s.execute("object.blend.make", &json!({"ids": [keys[0].0, keys[1].0], "steps": 3, "orientation": "path"})).unwrap()["id"].as_u64().unwrap(),
|
||||
);
|
||||
live(&s, blend, keys, false);
|
||||
let path = NodeId(s.execute("path.create", &json!({"d": "M264 160 L264 320"})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("select.set", &json!({"ids": [blend.0, path.0]})).unwrap();
|
||||
let before = serde_json::to_value(s.doc().unwrap().doc.as_ref()).unwrap();
|
||||
let mut retained = (cpu(), None);
|
||||
let warm = frame(&s, &mut retained, "anisotropic-before-replace");
|
||||
s.execute("object.blend.replaceSpine", &json!({})).unwrap();
|
||||
live(&s, blend, keys, false);
|
||||
assert!(s.doc().unwrap().doc.node(path).is_none());
|
||||
assert_eq!(s.doc().unwrap().selection.objects, vec![blend]);
|
||||
let n = s.doc().unwrap().doc.node(blend).unwrap();
|
||||
let NodeKind::Blend { spec, .. } = &n.kind else { panic!("INPUT: the fixture must remain a live blend") };
|
||||
let spine = spec.spine.as_ref().unwrap().bounds().unwrap();
|
||||
assert!(spine.width().abs() < 1e-8 && (spine.height() - 160.0).abs() < 1e-8, "INPUT: this is the fixed vertical rail");
|
||||
let expanded = vectorcraft_render::expand_live(n);
|
||||
let placed = expanded.iter().find(|n| n.id == keys[0]).unwrap();
|
||||
let b = placed.geometric_bounds().unwrap();
|
||||
assert!((b.width() - 80.0).abs() < 1e-8 && (b.height() - 8.0).abs() < 1e-8, "INPUT: Align to Path must really turn the key by 90 degrees");
|
||||
assert_eq!(placed.appearance.effects.len(), 1);
|
||||
assert_eq!(placed.appearance.effects[0].params["scaleH"], json!(scale_h));
|
||||
let replaced = frame(&s, &mut retained, &format!("rotated-transform-{scale_h}-replace"));
|
||||
assert!(replaced.pixels != warm.pixels, "INPUT: the replacement must really change the painted frame");
|
||||
move_and_undo(&mut s, &mut retained, blend, keys, false, &replaced);
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(serde_json::to_value(s.doc().unwrap().doc.as_ref()).unwrap(), before);
|
||||
let restored = frame(&s, &mut retained, "anisotropic-undo-replace");
|
||||
same_pixels(&restored, &warm);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blend_5179_rotated_transform_damage_contains_painted_pixels() {
|
||||
// The control completes every render, move and history check before the witness runs.
|
||||
rotated_transform_damage(200.0);
|
||||
rotated_transform_damage(400.0);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1956,6 +1956,149 @@ fn an_anchor_beside_a_drawn_dimension_takes_the_point() {
|
||||
assert_eq!(linear_marker(&mut s, zoomed, 125.5, 358.3), (Some((pt(126.0, 358.0), 10.0)), vec!["anchor".to_string()]));
|
||||
}
|
||||
|
||||
/// The Smart Guide lines a pointer move at (`x`, `y`) shows, as their ends.
|
||||
fn guide_lines(s: &mut Session, view: ViewInfo, x: f64, y: f64) -> Vec<(vectorcraft_geom::Point, vectorcraft_geom::Point)> {
|
||||
use vectorcraft_engine::tools::Overlay;
|
||||
s.pointer(&PointerEvent::new(PointerKind::Move, x, y), view).unwrap();
|
||||
s.overlays(view).into_iter().filter_map(|o| if let Overlay::Line { a, b, .. } = o { Some((a, b)) } else { None }).collect()
|
||||
}
|
||||
|
||||
/// An edge with anchors at x 100, 200 and 300, and a dimension from 100 to 200 placed 30 points
|
||||
/// above it, with the Dimension tool active and nothing selected: the session and the dimension.
|
||||
fn level_start(view: ViewInfo) -> (Session, u64) {
|
||||
let pt = vectorcraft_geom::Point::new;
|
||||
let mut s = session();
|
||||
run(&mut s, "path.create", json!({"d": "M100 200 L200 200 L300 200 L300 300 L100 300 Z"}));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
s.select_tool("dimension", view).unwrap();
|
||||
linear_click(&mut s, view, 100.0, 200.0);
|
||||
linear_click(&mut s, view, 200.0, 200.0);
|
||||
linear_click(&mut s, view, 150.0, 170.0);
|
||||
let first = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_eq!(recipe(&s, first).line_ends(), (pt(100.0, 170.0), pt(200.0, 170.0)));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
(s, first)
|
||||
}
|
||||
|
||||
/// The next dimension, from 200 to 300, placed with the pointer at `y`: where its line lies.
|
||||
fn level_next(s: &mut Session, view: ViewInfo, y: f64) -> (vectorcraft_geom::Point, vectorcraft_geom::Point) {
|
||||
linear_click(s, view, 200.0, 200.0);
|
||||
linear_click(s, view, 300.0, 200.0);
|
||||
linear_click(s, view, 250.0, y);
|
||||
let id = s.doc().unwrap().selection.objects[0].0;
|
||||
recipe(s, id).line_ends()
|
||||
}
|
||||
|
||||
/// A dimension placed next to another, with its line within the Smart Guides snapping tolerance of
|
||||
/// the level of the other's parallel line, has its line on that level. A level further off, Smart
|
||||
/// Guides off, a locked dimension or one that is not parallel leaves the line where the pointer
|
||||
/// puts it.
|
||||
#[test]
|
||||
fn a_dimension_line_placed_beside_another_lands_on_its_level() {
|
||||
let plain = ViewInfo::default();
|
||||
let off = ViewInfo { smart_guides: false, ..plain };
|
||||
let pt = vectorcraft_geom::Point::new;
|
||||
// 2.5 points below the first line's level, and 3.5 above it: on the level.
|
||||
for y in [172.5, 166.5] {
|
||||
let (mut s, _) = level_start(plain);
|
||||
assert_eq!(level_next(&mut s, plain, y), (pt(200.0, 170.0), pt(300.0, 170.0)), "pointer at y {y}");
|
||||
}
|
||||
// 10 points off: where the pointer is.
|
||||
let (mut s, _) = level_start(plain);
|
||||
assert_eq!(level_next(&mut s, plain, 180.0), (pt(200.0, 180.0), pt(300.0, 180.0)));
|
||||
// Smart Guides off: where the pointer is.
|
||||
let (mut s, _) = level_start(off);
|
||||
assert_eq!(level_next(&mut s, off, 172.5), (pt(200.0, 172.5), pt(300.0, 172.5)));
|
||||
// A locked dimension does not pull the line.
|
||||
let (mut s, first) = level_start(plain);
|
||||
run(&mut s, "select.set", json!({"ids":[first]}));
|
||||
run(&mut s, "object.lock", json!({}));
|
||||
assert_eq!(level_next(&mut s, plain, 172.5), (pt(200.0, 172.5), pt(300.0, 172.5)));
|
||||
// A dimension of the right edge has a vertical line, which is not parallel to the first: the
|
||||
// pointer 2.5 points below the first line's level places it where the pointer is.
|
||||
let (mut s, _) = level_start(plain);
|
||||
linear_click(&mut s, plain, 300.0, 200.0);
|
||||
linear_click(&mut s, plain, 300.0, 300.0);
|
||||
linear_click(&mut s, plain, 330.0, 172.5);
|
||||
let id = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_eq!(recipe(&s, id).line_ends(), (pt(330.0, 200.0), pt(330.0, 300.0)));
|
||||
}
|
||||
|
||||
/// While a dimension is placed with its line on the level of another, one alignment guide runs
|
||||
/// along the level across both lines. Off the level, after a dropped press and with Alignment
|
||||
/// Guides off, no guide shows.
|
||||
#[test]
|
||||
fn a_dimension_line_on_another_level_shows_one_guide_across_both() {
|
||||
let plain = ViewInfo::default();
|
||||
let pt = vectorcraft_geom::Point::new;
|
||||
let (mut s, _) = level_start(plain);
|
||||
linear_click(&mut s, plain, 200.0, 200.0);
|
||||
linear_click(&mut s, plain, 300.0, 200.0);
|
||||
let guides = guide_lines(&mut s, plain, 250.0, 172.5);
|
||||
assert!(guides.iter().any(|(a, b)| near(*a, pt(100.0, 170.0)) && near(*b, pt(300.0, 170.0))), "{guides:?}");
|
||||
assert!(guide_lines(&mut s, plain, 250.0, 180.0).is_empty(), "no guide off the level");
|
||||
// A press on the level that the app drops cancels the preview, and its guide goes with it.
|
||||
assert!(!guide_lines(&mut s, plain, 250.0, 172.5).is_empty());
|
||||
s.pointer(&PointerEvent::new(PointerKind::Down, 250.0, 172.5), plain).unwrap();
|
||||
s.drop_tool_press(plain).unwrap();
|
||||
assert!(s.overlays(plain).iter().all(|o| !matches!(o, vectorcraft_engine::tools::Overlay::Line { .. })), "{:?}", s.overlays(plain));
|
||||
// Alignment Guides off: the line still lands on the level, with no guide.
|
||||
let (mut s, _) = level_start(plain);
|
||||
run(&mut s, "prefs.set", json!({"key": "alignmentGuides", "value": false}));
|
||||
linear_click(&mut s, plain, 200.0, 200.0);
|
||||
linear_click(&mut s, plain, 300.0, 200.0);
|
||||
assert!(guide_lines(&mut s, plain, 250.0, 172.5).is_empty());
|
||||
linear_click(&mut s, plain, 250.0, 172.5);
|
||||
let id = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_eq!(recipe(&s, id).line_ends(), (pt(200.0, 170.0), pt(300.0, 170.0)));
|
||||
}
|
||||
|
||||
/// A second dimension of the same two points as a dimension already drawn lands on its level too.
|
||||
/// Off every level, a pointer moved in small steps while it is placed puts the line at each step,
|
||||
/// with no pull from the preview of the dimension itself.
|
||||
#[test]
|
||||
fn a_dimension_of_the_same_points_lines_up_and_the_line_follows_the_pointer() {
|
||||
let plain = ViewInfo::default();
|
||||
let pt = vectorcraft_geom::Point::new;
|
||||
let (mut s, first) = level_start(plain);
|
||||
linear_click(&mut s, plain, 100.0, 200.0);
|
||||
linear_click(&mut s, plain, 200.0, 200.0);
|
||||
linear_click(&mut s, plain, 150.0, 172.5);
|
||||
let id = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_ne!(id, first);
|
||||
assert_eq!(recipe(&s, id).line_ends(), (pt(100.0, 170.0), pt(200.0, 170.0)));
|
||||
let (mut s, _) = level_start(plain);
|
||||
linear_click(&mut s, plain, 200.0, 200.0);
|
||||
linear_click(&mut s, plain, 300.0, 200.0);
|
||||
for y in [190.0, 189.0, 188.0, 187.0, 186.0] {
|
||||
s.pointer(&PointerEvent::new(PointerKind::Move, 250.0, y), plain).unwrap();
|
||||
}
|
||||
for kind in [PointerKind::Down, PointerKind::Up] {
|
||||
s.pointer(&PointerEvent::new(kind, 250.0, 186.0), plain).unwrap();
|
||||
}
|
||||
let id = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_eq!(recipe(&s, id).line_ends(), (pt(200.0, 186.0), pt(300.0, 186.0)));
|
||||
}
|
||||
|
||||
/// A dimension dragged out from a segment, with its line within the Smart Guides snapping
|
||||
/// tolerance of the level of another dimension's parallel line, lands on that level.
|
||||
#[test]
|
||||
fn a_dimension_dragged_out_beside_another_lands_on_its_level() {
|
||||
let plain = ViewInfo::default();
|
||||
let pt = vectorcraft_geom::Point::new;
|
||||
// The bottom edge dragged out to 2 points below the level of the first line, 130 points
|
||||
// above the edge: on the level.
|
||||
let (mut s, _) = level_start(plain);
|
||||
for (kind, y) in
|
||||
[(PointerKind::Move, 300.0), (PointerKind::Down, 300.0), (PointerKind::Drag, 240.0), (PointerKind::Drag, 172.0), (PointerKind::Up, 172.0)]
|
||||
{
|
||||
s.pointer(&PointerEvent::new(kind, 160.0, y), plain).unwrap();
|
||||
}
|
||||
let id = s.doc().unwrap().selection.objects[0].0;
|
||||
let (a, b) = recipe(&s, id).line_ends();
|
||||
assert!(near(a, pt(300.0, 170.0)) && near(b, pt(100.0, 170.0)) || near(a, pt(100.0, 170.0)) && near(b, pt(300.0, 170.0)), "{a:?} {b:?}");
|
||||
}
|
||||
|
||||
/// The page content streams of exported PDF `v`, inflated.
|
||||
fn pdf_content(v: &Value) -> String {
|
||||
let bytes = vectorcraft_format::base64_decode(v["dataBase64"].as_str().unwrap()).unwrap();
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||||
|
||||
//! Production preflight must find actual delivery problems and clear them after repairs.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::NodeId;
|
||||
use vectorcraft_engine::Session;
|
||||
|
||||
fn new() -> Session {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({ "width": 500, "height": 400 })).unwrap();
|
||||
s
|
||||
}
|
||||
|
||||
fn check(s: &mut Session) -> Value {
|
||||
s.execute("document.preflight", &json!({})).unwrap()
|
||||
}
|
||||
|
||||
fn codes(report: &Value) -> Vec<&str> {
|
||||
report["findings"].as_array().unwrap().iter().map(|f| f["code"].as_str().unwrap()).collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_finds_four_problems_and_repairs_clear_each_one() {
|
||||
let dir = Folder::new("preflight-four");
|
||||
let path = dir.file("picture.png");
|
||||
let bytes = png(40, 40, [200, 50, 10]);
|
||||
std::fs::write(&path, &bytes).unwrap();
|
||||
let mut s = new();
|
||||
let text = s.execute("text.create", &json!({ "x": 10, "y": 10, "text": "Ab\nCd\nEf\nGh", "font": "Preflight Missing Family 917", "size": 12, "area": { "width": 100, "height": 20 } })).unwrap()["id"].clone();
|
||||
let image = s.execute("file.place", &json!({ "path": path, "at": [200, 200], "link": true })).unwrap()["ids"][0].clone();
|
||||
std::fs::remove_file(&path).unwrap();
|
||||
let before_doc = s.doc().unwrap().doc.clone();
|
||||
let before_sel = s.doc().unwrap().selection.clone();
|
||||
let revision = s.doc().unwrap().revision;
|
||||
let report = check(&mut s);
|
||||
for code in ["missingFont", "overflow", "missingLink", "lowResolution"] {
|
||||
assert!(codes(&report).contains(&code), "{code}: {report}");
|
||||
}
|
||||
assert_eq!(*before_doc, *s.doc().unwrap().doc);
|
||||
assert_eq!(before_sel, s.doc().unwrap().selection);
|
||||
assert_eq!(revision, s.doc().unwrap().revision, "checking doesn't edit the document");
|
||||
for f in report["findings"].as_array().unwrap() {
|
||||
assert!(f["ids"].as_array().unwrap().iter().all(|id| id == &text || id == &image), "{f}");
|
||||
}
|
||||
s.execute("text.areaOptions", &json!({ "ids": [text], "height": 150 })).unwrap();
|
||||
assert!(!codes(&check(&mut s)).contains(&"overflow"));
|
||||
std::fs::write(&path, &bytes).unwrap();
|
||||
s.execute("links.update", &json!({ "ids": [image] })).unwrap();
|
||||
assert!(!codes(&check(&mut s)).contains(&"missingLink"));
|
||||
s.execute("select.set", &json!({ "ids": [image] })).unwrap();
|
||||
s.execute("object.setBounds", &json!({ "width": 7.2, "height": 7.2 })).unwrap();
|
||||
assert!(!codes(&check(&mut s)).contains(&"lowResolution"));
|
||||
// Deleting the missing-font object fixes the final delivery issue on any machine, including
|
||||
// builds with no optional craft-fonts checkout or installed fonts.
|
||||
s.execute("select.set", &json!({ "ids": [text] })).unwrap();
|
||||
s.execute("edit.clear", &json!({})).unwrap();
|
||||
let clean = check(&mut s);
|
||||
assert!(codes(&clean).is_empty(), "{clean}");
|
||||
assert!(clean["checks"].as_array().unwrap().iter().all(|c| c["status"] == "passed"));
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert!(codes(&check(&mut s)).contains(&"missingFont"), "undo is checked too");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_reuses_link_probes_for_external_changes_without_an_edit() {
|
||||
let dir = Folder::new("preflight-modified");
|
||||
let path = dir.file("picture.png");
|
||||
std::fs::write(&path, png(40, 40, [200, 50, 10])).unwrap();
|
||||
let mut s = new();
|
||||
let image = s.execute("file.place", &json!({ "path": path, "at": [200, 200] })).unwrap()["ids"][0].clone();
|
||||
let rev = s.doc().unwrap().revision;
|
||||
std::fs::write(&path, png(41, 45, [10, 50, 200])).unwrap();
|
||||
assert!(codes(&check(&mut s)).contains(&"modifiedLink"));
|
||||
assert_eq!(rev, s.doc().unwrap().revision);
|
||||
s.execute("links.update", &json!({ "ids": [image] })).unwrap();
|
||||
assert!(!codes(&check(&mut s)).contains(&"modifiedLink"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_scopes_artboards_and_respects_hidden_and_nonprinting_layers() {
|
||||
let mut s = new();
|
||||
let id = s.execute("text.create", &json!({ "x": 10, "y": 30, "text": "Label", "font": "Preflight Missing Scope 917" })).unwrap()["id"].clone();
|
||||
s.execute("artboard.new", &json!({ "x": 600, "y": 0, "width": 500, "height": 400 })).unwrap();
|
||||
let other = s.execute("document.preflight", &json!({ "artboards": [1] })).unwrap();
|
||||
assert!(codes(&other).is_empty(), "{other}");
|
||||
assert!(codes(&check(&mut s)).contains(&"missingFont"));
|
||||
s.execute("object.setProps", &json!({ "ids": [id], "visible": false })).unwrap();
|
||||
assert!(codes(&check(&mut s)).is_empty());
|
||||
s.execute("object.setProps", &json!({ "ids": [id], "visible": true, "locked": true })).unwrap();
|
||||
assert!(codes(&check(&mut s)).contains(&"missingFont"), "locked artwork still exports");
|
||||
let layer = s.doc().unwrap().doc.layers[0].id;
|
||||
s.execute("layer.setProps", &json!({ "id": layer.0, "printable": false })).unwrap();
|
||||
let print = s.execute("document.preflight", &json!({ "output": "print" })).unwrap();
|
||||
assert!(codes(&print).is_empty(), "{print}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_resolution_follows_placed_size_and_both_axes() {
|
||||
let dir = Folder::new("preflight-resolution");
|
||||
let path = dir.file("picture.png");
|
||||
std::fs::write(&path, png(100, 100, [200, 50, 10])).unwrap();
|
||||
let mut s = new();
|
||||
let id = s.execute("file.place", &json!({ "path": path, "link": false, "at": [200, 200] })).unwrap()["ids"][0].clone();
|
||||
s.execute("select.set", &json!({ "ids": [id] })).unwrap();
|
||||
s.execute("object.setBounds", &json!({ "width": 24, "height": 72 })).unwrap();
|
||||
let r = check(&mut s);
|
||||
let f = r["findings"].as_array().unwrap().iter().find(|f| f["code"] == "lowResolution").unwrap();
|
||||
assert_eq!(f["effectivePpi"], json!([300.0, 100.0]));
|
||||
let screen = s.execute("document.preflight", &json!({ "output": "screen" })).unwrap();
|
||||
assert_eq!(screen["minPpi"], 96.0);
|
||||
assert!(codes(&screen).is_empty(), "{screen}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_resolution_accepts_the_exact_threshold_but_rejects_a_real_shortfall() {
|
||||
let dir = Folder::new("preflight-resolution-boundary");
|
||||
let path = dir.file("picture.png");
|
||||
std::fs::write(&path, png(40, 40, [200, 50, 10])).unwrap();
|
||||
let mut s = new();
|
||||
s.execute("file.place", &json!({ "path": path, "link": false, "at": [200, 200] })).unwrap();
|
||||
for threshold in [31.0, 59.0, 300.0, 600.0, 9600.0] {
|
||||
let size = 40.0 * 72.0 / threshold;
|
||||
s.execute("object.setBounds", &json!({ "width": size, "height": size })).unwrap();
|
||||
let exact = s.execute("document.preflight", &json!({ "minPpi": threshold })).unwrap();
|
||||
assert!(!codes(&exact).contains(&"lowResolution"), "exactly {threshold} ppi: {exact}");
|
||||
s.execute("object.setBounds", &json!({ "width": size * 1.000001, "height": size })).unwrap();
|
||||
let below = s.execute("document.preflight", &json!({ "minPpi": threshold })).unwrap();
|
||||
let f = below["findings"].as_array().unwrap().iter().find(|f| f["code"] == "lowResolution").unwrap();
|
||||
assert_eq!(f["threshold"], threshold);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_resolution_includes_the_print_jobs_scale() {
|
||||
let dir = Folder::new("preflight-print-scale");
|
||||
let path = dir.file("picture.png");
|
||||
std::fs::write(&path, png(100, 100, [200, 50, 10])).unwrap();
|
||||
let mut s = new();
|
||||
s.execute("file.place", &json!({ "path": path, "link": false, "at": [250, 200] })).unwrap();
|
||||
s.execute("object.setBounds", &json!({ "width": 24, "height": 24 })).unwrap();
|
||||
let doc = s.execute("document.preflight", &json!({ "minPpi": 200 })).unwrap();
|
||||
assert!(codes(&doc).is_empty(), "{doc}");
|
||||
s.execute("print.setup", &json!({ "settings": { "scaling": "custom", "scale": { "width": 200, "height": 200 } } })).unwrap();
|
||||
let print = s.execute("document.preflight", &json!({ "output": "print", "minPpi": 200 })).unwrap();
|
||||
let f = print["findings"].as_array().unwrap().iter().find(|f| f["code"] == "lowResolution").unwrap();
|
||||
assert_eq!(f["effectivePpi"], json!([150.0, 150.0]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_reports_a_frame_that_cannot_show_even_its_first_line() {
|
||||
let mut s = new();
|
||||
let id = s.execute("text.create", &json!({ "x": 10, "y": 10, "text": "Abc", "size": 30, "area": { "width": 100, "height": 1 } })).unwrap()["id"]
|
||||
.clone();
|
||||
let r = check(&mut s);
|
||||
assert!(r["findings"].as_array().unwrap().iter().any(|f| f["code"] == "overflow" && f["ids"] == json!([id])), "{r}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_reports_type_that_cannot_place_a_glyph_on_a_horizontal_path() {
|
||||
let mut s = new();
|
||||
let path = s.execute("path.create", &json!({ "d": "M10 20 L11 20" })).unwrap()["id"].clone();
|
||||
let id = s.execute("text.createInPath", &json!({ "path": path, "mode": "onPath", "text": "Longer than the path" })).unwrap()["id"].clone();
|
||||
let r = check(&mut s);
|
||||
assert!(r["findings"].as_array().unwrap().iter().any(|f| f["code"] == "overflow" && f["ids"] == json!([id])), "{r}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_bad_options_leave_document_and_selection_unchanged() {
|
||||
let mut s = new();
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
for p in [
|
||||
json!({ "output": "unknown" }),
|
||||
json!({ "output": 1 }),
|
||||
json!({ "minPpi": 0 }),
|
||||
json!({ "minPpi": "300" }),
|
||||
json!({ "artboards": [] }),
|
||||
json!({ "artboards": [0.5] }),
|
||||
json!({ "artboards": [999] }),
|
||||
] {
|
||||
assert!(s.execute("document.preflight", &p).is_err(), "{p}");
|
||||
assert_eq!(*doc, *s.doc().unwrap().doc);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preflight_resource_font_finding_locates_its_instance() {
|
||||
let mut s = new();
|
||||
let text = s.execute("text.create", &json!({ "x": 10, "y": 30, "text": "Label", "font": "Preflight Missing Symbol 917" })).unwrap()["id"].clone();
|
||||
s.execute("select.set", &json!({ "ids": [text] })).unwrap();
|
||||
s.execute("symbol.new", &json!({ "name": "Label" })).unwrap();
|
||||
let r = check(&mut s);
|
||||
let f = r["findings"].as_array().unwrap().iter().find(|f| f["code"] == "missingFont").unwrap();
|
||||
assert!(f["ids"].as_array().unwrap().iter().all(|id| s.doc().unwrap().doc.node(NodeId(id.as_u64().unwrap())).is_some()), "{r}");
|
||||
}
|
||||
|
||||
struct Folder(std::path::PathBuf);
|
||||
impl Folder {
|
||||
fn new(name: &str) -> Self {
|
||||
Self(vectorcraft_testkit::temp_dir(name))
|
||||
}
|
||||
fn file(&self, name: &str) -> String {
|
||||
self.0.join(name).to_string_lossy().into_owned()
|
||||
}
|
||||
}
|
||||
impl Drop for Folder {
|
||||
fn drop(&mut self) {
|
||||
let _ = std::fs::remove_dir_all(&self.0);
|
||||
}
|
||||
}
|
||||
fn png(w: u32, h: u32, rgb: [u8; 3]) -> Vec<u8> {
|
||||
let pixels = (0..w * h).flat_map(|_| [rgb[0], rgb[1], rgb[2], 255]).collect();
|
||||
let image =
|
||||
craft_image_codecs::Image::from_raw(w, h, craft_image_codecs::ChannelLayout::Rgba, craft_image_codecs::SampleType::U8, pixels).unwrap();
|
||||
craft_image_codecs::encode(&image, craft_image_codecs::Format::Png, &Default::default()).unwrap()
|
||||
}
|
||||
@@ -1663,6 +1663,37 @@ fn transform_refused_by_a_later_operation_changes_nothing() {
|
||||
assert_eq!(count(&mut s), base, "one undo removes the rectangle");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transform_rejects_a_mistyped_reflect_copy_or_origin_before_editing() {
|
||||
let inspect = |s: &mut Server, id| serde_json::from_str::<Value>(&text_of(&call(s, id, "doc_inspect", json!({})))).unwrap();
|
||||
let mut s = server();
|
||||
let first = id_of(&call(&mut s, 1, "draw_path", json!({"d": "M10 10 L30 10 L30 25 Z"})));
|
||||
let second = id_of(&call(&mut s, 2, "draw_path", json!({"d": "M40 40 L60 40 L60 55 Z"})));
|
||||
let before = inspect(&mut s, 3);
|
||||
let cases = [
|
||||
("object.reflect", json!({"dx": 10, "reflect": 42, "copy": true})),
|
||||
("object.reflect", json!({"dx": 10, "reflect": true})),
|
||||
("copy", json!({"dx": 10, "copy": "yes"})),
|
||||
("origin", json!({"dx": 10, "rotate": 30, "origin": "center", "copy": true})),
|
||||
("origin", json!({"dx": 10, "rotate": 30, "origin": [5]})),
|
||||
("origin", json!({"dx": 10, "rotate": 30, "origin": [5, "a"]})),
|
||||
];
|
||||
for (index, (says, mut args)) in cases.into_iter().enumerate() {
|
||||
args["ids"] = json!([first]);
|
||||
let request_id = 4 + index as u64 * 2;
|
||||
let rejected = call(&mut s, request_id, "transform", args.clone());
|
||||
assert_eq!(rejected["isError"], true, "{args}: {rejected}");
|
||||
assert!(text_of(&rejected).contains(says), "{args}: {rejected}");
|
||||
// The document, the selection and the undo history are as they were.
|
||||
assert_eq!(inspect(&mut s, request_id + 1), before, "{args}");
|
||||
}
|
||||
// A null `reflect`, `copy` or `origin` is left out.
|
||||
let applied = call(&mut s, 20, "transform", json!({"ids": [second], "dx": 10, "reflect": null, "copy": null, "origin": null}));
|
||||
assert_eq!(applied["isError"], false, "{applied}");
|
||||
let applied: Value = serde_json::from_str(&text_of(&applied)).unwrap();
|
||||
assert_eq!(applied["applied"], json!(["move"]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn add_text_rejects_invalid_path_effects_before_editing() {
|
||||
let mut s = server();
|
||||
|
||||
@@ -466,7 +466,7 @@ pub fn tool_definitions() -> Vec<Value> {
|
||||
tool(
|
||||
"transform",
|
||||
"Transform",
|
||||
"Move, rotate, scale, reflect or shear the selection (or `ids`); several may be combined and run in that order. Angles in degrees (counter-clockwise), scale in %. Scale and reflect act along the selection's bounding box, turned with rotated objects until Reset Bounding Box. `origin` [x,y] defaults to the selection centre; `copy` transforms a copy. A scale, reflect or shear its command refuses returns that error before any step runs, and nothing changes.",
|
||||
"Move, rotate, scale, reflect or shear the selection (or `ids`); several may be combined and run in that order. Angles in degrees (counter-clockwise), scale in %. Scale and reflect act along the selection's bounding box, turned with rotated objects until Reset Bounding Box. `origin` [x,y] defaults to the selection center; `copy` transforms a copy. A scale, reflect or shear its command refuses, or an argument of the wrong type, returns that error before any step runs, and nothing changes.",
|
||||
obj(
|
||||
json!({
|
||||
"ids": {"type": "array", "items": {"type": "integer"}},
|
||||
|
||||
@@ -303,7 +303,8 @@ pub(super) fn add_text(b: &mut dyn Backend, a: &Args) -> Result<Value, String> {
|
||||
|
||||
pub(super) fn transform(b: &mut dyn Backend, a: &Args) -> Result<Value, String> {
|
||||
// Each operation is its own command: check the params the later ones refuse before the first
|
||||
// runs, so a refused request changes nothing.
|
||||
// runs, so a refused request changes nothing. The `transform` arm of `dispatch` has already
|
||||
// refused a `dx`, `dy`, `rotate`, `scale`, `scaleX`, `scaleY` or `shear` that is not a number.
|
||||
fn bad(cmd: &'static str) -> impl Fn(String) -> String {
|
||||
move |e| format!("invalid parameters for `{cmd}`: {e}")
|
||||
}
|
||||
@@ -312,7 +313,12 @@ pub(super) fn transform(b: &mut dyn Backend, a: &Args) -> Result<Value, String>
|
||||
if sx.is_some() || sy.is_some() {
|
||||
vectorcraft_engine::cmd::scale_factors(sx.unwrap_or(100.0), sy.unwrap_or(100.0)).map_err(bad("object.scale"))?;
|
||||
}
|
||||
let reflect = a.get("reflect").and_then(Value::as_str);
|
||||
// A null `reflect`, `copy` or `origin` is left out.
|
||||
let reflect = match a.get("reflect") {
|
||||
None | Some(Value::Null) => None,
|
||||
Some(Value::String(axis)) => Some(axis.as_str()),
|
||||
Some(v) => return Err(format!("invalid parameters for `object.reflect`: axis must be \"vertical\" or \"horizontal\", not `{v}`")),
|
||||
};
|
||||
if let Some(axis) = reflect {
|
||||
vectorcraft_engine::cmd::reflect_axis(Some(&json!(axis))).map_err(bad("object.reflect"))?;
|
||||
}
|
||||
@@ -320,9 +326,18 @@ pub(super) fn transform(b: &mut dyn Backend, a: &Args) -> Result<Value, String>
|
||||
if let Some(sh) = shear {
|
||||
vectorcraft_engine::cmd::shear_tangent(sh).map_err(bad("object.shear"))?;
|
||||
}
|
||||
let copy = match a.get("copy") {
|
||||
None | Some(Value::Null) => false,
|
||||
Some(v) => v.as_bool().ok_or_else(|| format!("`copy` must be true or false, not {v}"))?,
|
||||
};
|
||||
if let Some(o) = a.get("origin").filter(|o| !o.is_null())
|
||||
&& !o.as_array().is_some_and(|xy| xy.len() == 2 && xy.iter().all(Value::is_number))
|
||||
{
|
||||
return Err(format!("`origin` must be [x, y], not {o}"));
|
||||
}
|
||||
select_ids(b, a)?;
|
||||
// With `copy`, the first operation duplicates and the rest transform the copy (the new selection).
|
||||
let copy = std::cell::Cell::new(a.get("copy").and_then(Value::as_bool).unwrap_or(false));
|
||||
let copy = std::cell::Cell::new(copy);
|
||||
let with = |mut p: Value| {
|
||||
if let Some(o) = a.get("origin") {
|
||||
p["origin"] = o.clone();
|
||||
|
||||
@@ -688,7 +688,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"window.panel.float",
|
||||
"Float Panel",
|
||||
"",
|
||||
"{panel: id or \"tools\", x?, y?, width?, height?, group?: bool, column?: bool or n, onto?: id, above?: id, below?: id, collapsed?: bool} float a panel (with `group`, its whole group; with `column`, its whole dock column or floating window) as a floating window with its top-left corner at x, y in window points (default: inside the dock area, cascaded), as dragging its tab out does; a whole floating window keeps its rect unless given one. `onto` makes it a tab of the floating group holding that panel instead; `above` / `below` a group of its own above or below the group holding that panel, in its floating window or dock column. `collapsed` then minimizes (true) or restores (false) its window or group. A hidden panel shows first. \"tools\" floats the Tools panel at x, y. Returns {layout, closed, floating}",
|
||||
"{panel: id or \"tools\", x?, y?, width?, height?, group?: bool, column?: bool or n, onto?: id, above?: id, below?: id, collapsed?: bool} float a panel (with `group`, its whole group; with `column`, its whole dock column or floating window) as a floating window with its top-left corner at x, y in window points (default: inside the dock area, cascaded), as dragging its tab out does; a whole floating window keeps its rect unless given one. Supplied geometry also moves or resizes an existing native window; omitted components keep their current values. `onto` makes it a tab of the floating group holding that panel instead; `above` / `below` a group of its own above or below the group holding that panel, in its floating window or dock column. `collapsed` then minimizes (true) or restores (false) its window or group. A hidden panel shows first. \"tools\" floats the Tools panel at x, y. Returns {layout, closed, floating}",
|
||||
),
|
||||
(
|
||||
"window.panel.dock",
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
//! Both are found as roots over the normal's angle: sampled, then refined by bisection, with
|
||||
//! sampled minima refined too so that a double root (outlines that touch) or two roots between
|
||||
//! neighboring samples are kept.
|
||||
//!
|
||||
//! One of the two may be a point instead ([`Outline::point`]): its support value is `p · n`, and
|
||||
//! the tangents are the lines through it that touch the other outline.
|
||||
|
||||
use std::f64::consts::TAU;
|
||||
|
||||
@@ -60,7 +63,7 @@ pub enum OutlineError {
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub struct Coincide;
|
||||
|
||||
/// A convex closed outline that [`common_tangents`] takes.
|
||||
/// A convex closed outline, or a point, that [`common_tangents`] takes.
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Outline {
|
||||
/// The unit circle under an affine map: the center is the map's translation, `m` its linear
|
||||
@@ -70,9 +73,19 @@ pub enum Outline {
|
||||
/// when the segments run counter-clockwise (y up); the segment where `p · n` is largest then
|
||||
/// comes later in the list as the angle of `n` grows.
|
||||
Convex { segments: Vec<CubicBez>, center: Point, size: f64, ccw: bool },
|
||||
/// A single point.
|
||||
Point { at: Point },
|
||||
}
|
||||
|
||||
impl Outline {
|
||||
/// The point `at`, whose tangents are the lines through it.
|
||||
pub fn point(at: Point) -> Result<Self, OutlineError> {
|
||||
if !at.x.is_finite() || !at.y.is_finite() {
|
||||
return Err(OutlineError::Empty);
|
||||
}
|
||||
Ok(Outline::Point { at })
|
||||
}
|
||||
|
||||
/// The ellipse that `unit` maps the unit circle onto.
|
||||
pub fn ellipse(unit: Affine) -> Result<Self, OutlineError> {
|
||||
let [a, b, c, d, e, f] = unit.as_coeffs();
|
||||
@@ -183,6 +196,7 @@ impl Outline {
|
||||
size: *size,
|
||||
ccw: *ccw,
|
||||
},
|
||||
Outline::Point { at } => Outline::Point { at: *at + d },
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +217,7 @@ impl Outline {
|
||||
/// The support value at `n` and the segment it is reached on, from every segment.
|
||||
fn support_scan(&self, n: Vec2) -> (f64, usize) {
|
||||
match self {
|
||||
Outline::Ellipse { .. } => (self.support(n), 0),
|
||||
Outline::Ellipse { .. } | Outline::Point { .. } => (self.support(n), 0),
|
||||
Outline::Convex { segments, .. } => {
|
||||
let mut best = (f64::MIN, 0);
|
||||
for (i, s) in segments.iter().enumerate() {
|
||||
@@ -222,7 +236,7 @@ impl Outline {
|
||||
/// where the support value was reached at a normal angle a little less than `n`'s.
|
||||
fn support_from(&self, n: Vec2, from: usize) -> (f64, usize) {
|
||||
match self {
|
||||
Outline::Ellipse { .. } => (self.support(n), 0),
|
||||
Outline::Ellipse { .. } | Outline::Point { .. } => (self.support(n), 0),
|
||||
Outline::Convex { segments, ccw, .. } => {
|
||||
let len = segments.len();
|
||||
if len == 0 {
|
||||
@@ -251,14 +265,20 @@ impl Outline {
|
||||
}
|
||||
}
|
||||
|
||||
/// The center: an ellipse's, or a path's center of area.
|
||||
/// The center: an ellipse's, a path's center of area, or the point itself.
|
||||
pub fn center(&self) -> Point {
|
||||
match self {
|
||||
Outline::Ellipse { center, .. } | Outline::Convex { center, .. } => *center,
|
||||
Outline::Point { at } => *at,
|
||||
}
|
||||
}
|
||||
|
||||
/// The diagonal of the bounds (an ellipse's: of the box its axes span).
|
||||
/// Whether this is a point.
|
||||
pub fn is_point(&self) -> bool {
|
||||
matches!(self, Outline::Point { .. })
|
||||
}
|
||||
|
||||
/// The diagonal of the bounds (an ellipse's: of the box its axes span; a point's: 0).
|
||||
pub fn size(&self) -> f64 {
|
||||
match self {
|
||||
Outline::Ellipse { m, .. } => {
|
||||
@@ -266,6 +286,7 @@ impl Outline {
|
||||
2.0 * (a.hypot(c).powi(2) + b.hypot(d).powi(2)).sqrt()
|
||||
}
|
||||
Outline::Convex { size, .. } => *size,
|
||||
Outline::Point { .. } => 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,6 +301,7 @@ impl Outline {
|
||||
}
|
||||
best
|
||||
}
|
||||
Outline::Point { at } => at.to_vec2().dot(n),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,6 +342,7 @@ impl Outline {
|
||||
let Some(&(peak, _)) = all.iter().max_by(|x, y| x.1.total_cmp(&y.1)) else { return vec![] };
|
||||
all.into_iter().filter(|(p, v)| h - v <= tol + slope * (*p - peak).hypot()).map(|(p, _)| p).collect()
|
||||
}
|
||||
Outline::Point { at } => vec![*at],
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -406,7 +429,14 @@ fn dir(angle: f64) -> Vec2 {
|
||||
/// the angle of its normal. Separate outlines have two of each; overlapping ones only external
|
||||
/// ones (two for ellipses, possibly more for paths whose outlines cross more often); one inside the
|
||||
/// other none; outlines that touch share one tangent where they touch.
|
||||
///
|
||||
/// When one of them is a point, its external and internal tangents are the same lines, and they
|
||||
/// come back as external ones: two when the point lies outside the other outline, one when it lies
|
||||
/// on it, none inside. Two points have none.
|
||||
pub fn common_tangents(a: &Outline, b: &Outline) -> Result<Vec<Tangent>, Coincide> {
|
||||
if a.is_point() && b.is_point() {
|
||||
return Ok(vec![]);
|
||||
}
|
||||
// Worked out about the point between the two centers.
|
||||
let origin = (a.center().to_vec2() + b.center().to_vec2()) / 2.0;
|
||||
let (a, b) = (&a.shifted(-origin), &b.shifted(-origin));
|
||||
@@ -434,7 +464,11 @@ pub fn common_tangents(a: &Outline, b: &Outline) -> Result<Vec<Tangent>, Coincid
|
||||
let (ha, hb, hb_back) = (hints(a, 1.0), hints(b, 1.0), hints(b, -1.0));
|
||||
let hint = |h: &[usize], k: usize| h.get(k).copied().unwrap_or(0);
|
||||
let external = roots(&at, &|t, k| a.support_from(dir(t), hint(&ha, k)).0 - b.support_from(dir(t), hint(&hb, k)).0, tol)?;
|
||||
let internal = roots(&at, &|t, k| a.support_from(dir(t), hint(&ha, k)).0 + b.support_from(-dir(t), hint(&hb_back, k)).0, tol)?;
|
||||
let internal = if a.is_point() || b.is_point() {
|
||||
vec![]
|
||||
} else {
|
||||
roots(&at, &|t, k| a.support_from(dir(t), hint(&ha, k)).0 + b.support_from(-dir(t), hint(&hb_back, k)).0, tol)?
|
||||
};
|
||||
let (a, b) = (Hinted { o: a, at: &at, hints: &ha }, Hinted { o: b, at: &at, hints: &hb });
|
||||
let mut out = Vec::with_capacity(external.len() + internal.len());
|
||||
for (kind, list) in [(TangentKind::External, external), (TangentKind::Internal, internal)] {
|
||||
@@ -506,8 +540,13 @@ fn tangent_at(a: &Hinted, b: &Hinted, kind: TangentKind, angle: f64, double: boo
|
||||
// A double root's angle is found less exactly than a simple one's, so touching points may
|
||||
// stand a little apart.
|
||||
let (from, to) = if double && hi - lo <= 1e-6 * size {
|
||||
// Touching at one point: the narrower outline's width along the line, centered there.
|
||||
let width = [a, b].map(|o| o.support(angle + TAU / 4.0).0 + o.support(angle - TAU / 4.0).0).into_iter().fold(f64::MAX, f64::min);
|
||||
// Touching at one point: the narrower outline's width along the line, centered there. A
|
||||
// point on the other outline takes that outline's width.
|
||||
let width = [a, b]
|
||||
.into_iter()
|
||||
.filter(|o| !o.o.is_point())
|
||||
.map(|o| o.support(angle + TAU / 4.0).0 + o.support(angle - TAU / 4.0).0)
|
||||
.fold(f64::MAX, f64::min);
|
||||
let mid = (lo + hi) / 2.0;
|
||||
(mid - width / 2.0, mid + width / 2.0)
|
||||
} else if mean(&on_a) <= mean(&on_b) {
|
||||
@@ -975,6 +1014,127 @@ mod tests {
|
||||
assert!((best - 0.25).abs() < 1e-12, "{best}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_point_outside_a_turned_ellipse_has_two_tangents_through_it() {
|
||||
let m = ellipse_map(100.0, 50.0, 40.0, 15.0, 30.0);
|
||||
let (oval, p) = (Outline::ellipse(m).unwrap(), Point::new(-60.0, 120.0));
|
||||
let samples = sample_ellipse(m, 5_000);
|
||||
for point_first in [true, false] {
|
||||
let point = Outline::point(p).unwrap();
|
||||
let all = if point_first { common_tangents(&point, &oval) } else { common_tangents(&oval, &point) }.unwrap();
|
||||
assert_eq!(all.len(), 2, "{all:?}");
|
||||
for t in &all {
|
||||
assert_eq!(t.kind, TangentKind::External);
|
||||
// Each runs from the first outline given to the second: from the point when it
|
||||
// comes first.
|
||||
let (at_point, on_oval) = if point_first { (t.from, t.to) } else { (t.to, t.from) };
|
||||
assert!((at_point - p).hypot() < 1e-9, "{t:?}");
|
||||
// Taken back to the unit circle, the far end lies on it and the line runs square to
|
||||
// its radius there.
|
||||
let inv = m.inverse();
|
||||
let (q, d) = ((inv * on_oval).to_vec2(), (inv * on_oval) - (inv * at_point));
|
||||
assert!((q.hypot() - 1.0).abs() < 1e-9, "{q:?}");
|
||||
assert!((q.dot(d) / d.hypot()).abs() < 1e-7, "{q:?} {d:?}");
|
||||
// The whole ellipse lies on one side of the line.
|
||||
let dir = on_oval - at_point;
|
||||
let n = Vec2::new(-dir.y, dir.x) / dir.hypot();
|
||||
let side: Vec<f64> = samples.iter().map(|s| (*s - at_point).dot(n)).collect();
|
||||
let (lo, hi) = side.iter().fold((f64::MAX, f64::MIN), |(lo, hi), v| (lo.min(*v), hi.max(*v)));
|
||||
assert!(lo > -1e-6 || hi < 1e-6, "crosses: {lo} .. {hi}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_point_on_inside_and_beside_a_path() {
|
||||
// On a circle: the one tangent there, centered on the point and as long as the circle is
|
||||
// wide.
|
||||
let on = common_tangents(&Outline::point(Point::new(10.0, 0.0)).unwrap(), &circle(0.0, 0.0, 10.0)).unwrap();
|
||||
assert_eq!(on.len(), 1, "{on:?}");
|
||||
assert!(ends_within(&on[0], Point::new(10.0, -10.0), Point::new(10.0, 10.0), 1e-5), "{on:?}");
|
||||
// Inside, and two points: none.
|
||||
assert!(common_tangents(&Outline::point(Point::new(3.0, 4.0)).unwrap(), &circle(0.0, 0.0, 10.0)).unwrap().is_empty());
|
||||
let two = (Outline::point(Point::new(0.0, 0.0)).unwrap(), Outline::point(Point::new(5.0, 0.0)).unwrap());
|
||||
assert!(common_tangents(&two.0, &two.1).unwrap().is_empty());
|
||||
// Beside a square, in line with its bottom side: that tangent covers the whole side, and
|
||||
// the other one touches the corner at (10, 10).
|
||||
let square = SubPath::polyline(&[(0.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0)].map(Point::from), true);
|
||||
let sq = Outline::convex(&square).unwrap();
|
||||
let p = Point::new(20.0, 0.0);
|
||||
let all = common_tangents(&Outline::point(p).unwrap(), &sq).unwrap();
|
||||
assert_eq!(all.len(), 2, "{all:?}");
|
||||
assert!(all.iter().any(|t| ends_at(t, p, Point::new(0.0, 0.0))), "{all:?}");
|
||||
assert!(all.iter().any(|t| ends_at(t, p, Point::new(10.0, 10.0))), "{all:?}");
|
||||
assert!(all.iter().all(|t| (t.from - p).hypot() < 1e-9), "from the point: {all:?}");
|
||||
// On a straight side, off its middle: the one tangent is that side, covered whole.
|
||||
let side = common_tangents(&Outline::point(Point::new(2.0, 0.0)).unwrap(), &sq).unwrap();
|
||||
assert_eq!(side.len(), 1, "{side:?}");
|
||||
assert!(ends_at(&side[0], Point::new(0.0, 0.0), Point::new(10.0, 0.0)), "{side:?}");
|
||||
// At a corner of the square: one line through the corner, at the middle of the directions
|
||||
// that touch there, as long as the square is wide along it.
|
||||
let corner = common_tangents(&Outline::point(Point::new(10.0, 10.0)).unwrap(), &sq).unwrap();
|
||||
assert_eq!(corner.len(), 1, "{corner:?}");
|
||||
// The diagonal is 10√2 long, so each end lies 5√2 from the corner, along (1, -1).
|
||||
assert!(ends_within(&corner[0], Point::new(15.0, 5.0), Point::new(5.0, 15.0), 1e-5), "{corner:?}");
|
||||
// A point that is not finite is refused.
|
||||
assert_eq!(Outline::point(Point::new(f64::NAN, 0.0)).err(), Some(OutlineError::Empty));
|
||||
assert_eq!(Outline::point(Point::new(0.0, f64::INFINITY)).err(), Some(OutlineError::Empty));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_point_placed_on_a_turned_outline_has_one_tangent() {
|
||||
// A point worked out on the outline lies a rounding error inside or outside it, and still
|
||||
// gets the one line there, as long as the outline is wide along it.
|
||||
let one = |p: Point, o: &Outline, samples: &[Point]| {
|
||||
let all = common_tangents(&Outline::point(p).unwrap(), o).unwrap();
|
||||
assert_eq!(all.len(), 1, "{p:?}: {all:?}");
|
||||
// The line runs through the point.
|
||||
let (a, d) = (all[0].from, all[0].to - all[0].from);
|
||||
assert!(d.hypot() > 1.0 && ((p - a).cross(d) / d.hypot()).abs() < 1e-6, "{p:?}: {all:?}");
|
||||
// Its length is the outline's width along it, measured on dense samples.
|
||||
let u = d / d.hypot();
|
||||
let (lo, hi) = samples.iter().map(|s| s.to_vec2().dot(u)).fold((f64::MAX, f64::MIN), |(lo, hi), v| (lo.min(v), hi.max(v)));
|
||||
assert!((d.hypot() - (hi - lo)).abs() < 1e-3, "{p:?}: {} against {}", d.hypot(), hi - lo);
|
||||
};
|
||||
let m = ellipse_map(100.0, 50.0, 40.0, 15.0, 30.0);
|
||||
let (oval, oval_samples) = (Outline::ellipse(m).unwrap(), sample_ellipse(m, 20_000));
|
||||
for k in 0..37 {
|
||||
let a = 0.17 + k as f64 * TAU / 37.0;
|
||||
one(m * Point::new(a.cos(), a.sin()), &oval, &oval_samples);
|
||||
}
|
||||
// A closed Bézier circle, turned and moved: on each anchor and partway along each segment.
|
||||
let turned = shapes::ellipse(Rect::new(-60.0, -60.0, 60.0, 60.0)).transformed(Affine::translate((37.3, -12.9)) * Affine::rotate(0.7));
|
||||
let sp = turned.subpaths[0].clone();
|
||||
let (path, path_samples) = (Outline::convex(&sp).unwrap(), sample_path(&sp, 5_000));
|
||||
for an in sp.anchors.iter() {
|
||||
one(an.p, &path, &path_samples);
|
||||
}
|
||||
for k in 0..sp.segment_count() {
|
||||
for t in [0.21, 0.5, 0.83] {
|
||||
one(sp.segment(k).eval(t), &path, &path_samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_point_within_the_touching_tolerance_counts_as_on_the_outline() {
|
||||
// The tolerance is a billionth of the larger of the circle's size and the point's distance
|
||||
// from its center: closer than that, inside or outside, the point gets the one line there.
|
||||
let round = circle(0.0, 0.0, 10.0);
|
||||
let tol = 1e-9 * round.size().max(10.0);
|
||||
let at = |dx: f64| common_tangents(&Outline::point(Point::new(10.0 + dx, 0.0)).unwrap(), &round).unwrap();
|
||||
for dx in [-0.5 * tol, 0.5 * tol] {
|
||||
let on = at(dx);
|
||||
assert_eq!(on.len(), 1, "{dx}: {on:?}");
|
||||
assert!(ends_within(&on[0], Point::new(10.0, -10.0), Point::new(10.0, 10.0), 1e-5), "{dx}: {on:?}");
|
||||
}
|
||||
// Farther than that, a point inside gets none and a point outside gets two.
|
||||
assert!(at(-100.0 * tol).is_empty());
|
||||
assert_eq!(at(100.0 * tol).len(), 2);
|
||||
assert!(at(-1e-6).is_empty());
|
||||
assert_eq!(at(1e-6).len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn open_concave_empty_and_identical_outlines_are_refused() {
|
||||
let open = SubPath::polyline(&[Point::new(0.0, 0.0), Point::new(10.0, 0.0), Point::new(10.0, 10.0)], false);
|
||||
|
||||
@@ -203,6 +203,21 @@ pub fn quantize_to(rgba: &[u8], width: u32, height: u32, o: &PaletteOptions, pal
|
||||
finish(px, &colors, width, height, &palette, o, o.dither)
|
||||
}
|
||||
|
||||
/// For each pixel of `rgba`, the entry of `palette` nearest its color, as [`quantize_to`] measures
|
||||
/// it (the matte, transparency and `o.reduction`'s distance weights) without dither; `None` for a
|
||||
/// pixel that becomes transparent, and for every pixel when `palette` is empty.
|
||||
pub fn nearest_entries(rgba: &[u8], o: &PaletteOptions, palette: &[[u8; 3]]) -> Vec<Option<usize>> {
|
||||
let px = rgba.as_chunks::<4>().0;
|
||||
let colors = opaque_colors(px, o, false);
|
||||
let pal: Vec<[f32; 3]> = palette.iter().map(|c| c.map(f32::from)).collect();
|
||||
let index = PaletteIndex::new(&pal, o.reduction.weights());
|
||||
colors
|
||||
.iter()
|
||||
.zip(px)
|
||||
.map(|(c, p)| if pal.is_empty() || (o.transparency && p[3] < 128) { None } else { Some(index.nearest(c.map(f32::from))) })
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The color of each pixel when opaque: blended over the matte, and gray when `gray`.
|
||||
fn opaque_colors(px: &[[u8; 4]], o: &PaletteOptions, gray: bool) -> Vec<[u8; 3]> {
|
||||
let matte = o.matte.unwrap_or([255; 3]);
|
||||
|
||||
@@ -80,14 +80,19 @@ fn lossy_makes_runs_and_smaller_gifs() {
|
||||
let px = image(96, 64, |x, y| [(x * 2 + y) as u8, (y * 3) as u8, ((x * y) % 255) as u8]);
|
||||
let ix = quantize(&px, 96, 64, &PaletteOptions { colors: 64, dither: Dither::Diffusion, ..Default::default() });
|
||||
let mut lossy_ix = ix.clone();
|
||||
lossy(&mut lossy_ix, &px, 80);
|
||||
lossy(&mut lossy_ix, &px, 80, &[]);
|
||||
let runs = |ix: &Indexed| ix.indices.windows(2).filter(|w| w[0] != w[1]).count();
|
||||
assert!(runs(&lossy_ix) < runs(&ix));
|
||||
let size = |ix: &Indexed| gif::encode(ix, false).unwrap().len();
|
||||
assert!(size(&lossy_ix) < size(&ix), "{} vs {}", size(&lossy_ix), size(&ix));
|
||||
let mut none = ix.clone();
|
||||
lossy(&mut none, &px, 0);
|
||||
lossy(&mut none, &px, 0, &[]);
|
||||
assert_eq!(none, ix);
|
||||
// A fixed entry keeps its pixels and takes no others.
|
||||
let fixed: Vec<u8> = (0..ix.palette.len()).filter_map(|i| u8::try_from(i).ok()).collect();
|
||||
let mut kept = ix.clone();
|
||||
lossy(&mut kept, &px, 100, &fixed);
|
||||
assert_eq!(kept, ix);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -83,19 +83,24 @@ pub fn to_transparent(ix: &mut Indexed, mapped: impl Fn(usize) -> bool) -> Vec<O
|
||||
|
||||
/// Lossy GIF compression: a pixel takes the entry of the pixel left of it when that entry is
|
||||
/// within `amount` (0–100) of its own colour in `rgba` (the straight pixels it was reduced from).
|
||||
/// Longer runs of one index compress better in a GIF, at the cost of some noise.
|
||||
pub fn lossy(ix: &mut Indexed, rgba: &[u8], amount: u8) {
|
||||
/// Longer runs of one index compress better in a GIF, at the cost of some noise. No pixel moves
|
||||
/// into or out of the transparent entry or an entry in `fixed`.
|
||||
pub fn lossy(ix: &mut Indexed, rgba: &[u8], amount: u8, fixed: &[u8]) {
|
||||
let w = ix.width as usize;
|
||||
if amount == 0 || w == 0 || rgba.len() != ix.indices.len() * 4 {
|
||||
return;
|
||||
}
|
||||
// Up to 64 levels apart in each channel at 100.
|
||||
let limit = (f32::from(amount.min(100)) / 100.0 * 64.0).powi(2) * 3.0;
|
||||
let mut held = [false; 256];
|
||||
for i in fixed.iter().chain(&ix.transparent) {
|
||||
held[usize::from(*i)] = true;
|
||||
}
|
||||
let px = rgba.as_chunks::<4>().0;
|
||||
for (row, src) in ix.indices.chunks_mut(w).zip(px.chunks(w)) {
|
||||
for x in 1..row.len() {
|
||||
let (prev, cur) = (row[x - 1], row[x]);
|
||||
if prev == cur || ix.transparent.is_some_and(|t| t == prev || t == cur) {
|
||||
if prev == cur || held[usize::from(prev)] || held[usize::from(cur)] {
|
||||
continue;
|
||||
}
|
||||
let (Some(c), Some(p)) = (src.get(x), ix.palette.get(prev as usize)) else { continue };
|
||||
|
||||
@@ -64,10 +64,13 @@ use crate::{Frame, Renderer, blend_mode, fill_rule, paint};
|
||||
mod bounds;
|
||||
mod entries;
|
||||
mod pixels;
|
||||
mod placement;
|
||||
mod predicates;
|
||||
mod raster;
|
||||
mod renderer;
|
||||
|
||||
pub use placement::pinned_appearance_for_geometry_edit;
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) use bounds::visual_bounds;
|
||||
pub(crate) use bounds::{
|
||||
|
||||
@@ -726,6 +726,12 @@ fn cull_bounds_in(symbols: &SymbolBoxes, n: &Node, after_reshape: bool, brush: b
|
||||
let a = art_effects_reach(symbols, n);
|
||||
Some(b.inflate(a, a))
|
||||
}
|
||||
// A spine can rotate a blend's keys and steps past their unrotated visual bounds.
|
||||
NodeKind::Blend { .. } => {
|
||||
let b = n.reach_bounds_with(symbols)?;
|
||||
let a = live_content_reach(symbols, n);
|
||||
vectorcraft_geom::union_opt(Some(b.inflate(a, a)), placed_blend_effect_bounds(symbols, n))
|
||||
}
|
||||
_ => {
|
||||
let b = n.visual_bounds_with(symbols)?;
|
||||
let b = match &n.kind {
|
||||
@@ -804,16 +810,43 @@ pub(crate) fn with_own_raster_reach(symbols: &SymbolBoxes, n: &Node, b: Rect) ->
|
||||
b.inflate(o, o)
|
||||
}
|
||||
|
||||
/// `n`'s own visual box, type's grown to hold its glyphs ([`glyphs_box`]): what it draws when its
|
||||
/// object effects leave it as it is (Revolve builds no art from type).
|
||||
/// `n`'s own box, type's grown to hold its glyphs ([`glyphs_box`]) and a blend's to hold its
|
||||
/// spine-placed keys and steps: what it draws when its object effects leave it as it is
|
||||
/// (Revolve builds no art from type).
|
||||
fn own_box(symbols: &SymbolBoxes, n: &Node) -> Option<Rect> {
|
||||
let b = n.visual_bounds_with(symbols)?;
|
||||
let b = match &n.kind {
|
||||
NodeKind::Blend { .. } => vectorcraft_geom::union_opt(n.reach_bounds_with(symbols), placed_blend_effect_bounds(symbols, n)),
|
||||
_ => n.visual_bounds_with(symbols),
|
||||
}?;
|
||||
Some(match &n.kind {
|
||||
NodeKind::Text(t) => vectorcraft_geom::union_opt(Some(b), glyphs_box(t, n.appearance.outset())).unwrap_or(b),
|
||||
_ => b,
|
||||
})
|
||||
}
|
||||
|
||||
/// A rotated blend's effect-bearing content, measured after spine placement. Geometry effects
|
||||
/// run on the placed shapes, so their reach on the original keys need not cover what they paint.
|
||||
/// Effect-free blends keep the quick rail envelope without evaluating their steps.
|
||||
fn placed_blend_effect_bounds(symbols: &SymbolBoxes, n: &Node) -> Option<Rect> {
|
||||
let NodeKind::Blend { spec, .. } = &n.kind else { return None };
|
||||
if spec.orientation != vectorcraft_doc::BlendOrientation::AlignToPath {
|
||||
return None;
|
||||
}
|
||||
let mut has_effects = false;
|
||||
n.walk(&mut |c| {
|
||||
has_effects |= has_fx(c)
|
||||
|| has_object_fx(c)
|
||||
|| match &c.kind {
|
||||
NodeKind::SymbolInstance { symbol, .. } => symbols.has_effects(symbol),
|
||||
_ => false,
|
||||
};
|
||||
});
|
||||
if !has_effects {
|
||||
return None;
|
||||
}
|
||||
effects::expand_live(Some(symbols.document()), n).iter().fold(None, |acc, c| vectorcraft_geom::union_opt(acc, cull_bounds(symbols, c)))
|
||||
}
|
||||
|
||||
/// The box of type `t`'s glyphs as laid out (its layout bounds, else laid out now), grown by its
|
||||
/// characters' strokes, miter spikes included, and by `outset`: on a path they stand above it and
|
||||
/// run past its ends, in an area they can hang past its frame, where its own box
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
//! Stored gradient fits for geometry edits on the renderer's ordinary shape/container paths.
|
||||
|
||||
use vectorcraft_color::Paint;
|
||||
use vectorcraft_doc::{Appearance, AppearanceItem, Document, Effect, Node, NodeKind};
|
||||
use vectorcraft_effects::{self as effects, GeomContext};
|
||||
use vectorcraft_geom::{BezPath, Rect, Shape};
|
||||
|
||||
use super::bounds::{apply_carrying, effected_path_carrying, item_effects, node_bezpath};
|
||||
use super::predicates::has_non_container_art_fx;
|
||||
use super::renderer::carried;
|
||||
|
||||
/// Store the current renderer fit of gradients that can be represented by the existing appearance.
|
||||
///
|
||||
/// Alternate materialized art, visible plug-ins, Rasterize and path-coordinate stroke gradients
|
||||
/// keep their existing fit behavior. An unsupported or non-roundtripping carry also leaves its row
|
||||
/// unchanged; this neither flattens art nor changes persisted effects. `None` makes no change.
|
||||
pub fn pinned_appearance_for_geometry_edit(doc: &Document, n: &Node) -> Option<Appearance> {
|
||||
if !n.appearance.has_unplaced_gradient() || unsupported(n) || has_non_container_art_fx(n) {
|
||||
return None;
|
||||
}
|
||||
// Enclosing geometry effects change the fit outside this node-local pass.
|
||||
// Without that context, leave the paint fitted rather than storing a false frame.
|
||||
if doc.ancestry(n.id)?.into_iter().filter(|&id| id != n.id).any(|id| {
|
||||
doc.node(id).is_some_and(|ancestor| {
|
||||
matches!(ancestor.kind, NodeKind::Group { .. } | NodeKind::Layer { .. }) && effects::has_geometry(&ancestor.appearance.effects)
|
||||
})
|
||||
}) {
|
||||
return None;
|
||||
}
|
||||
match &n.kind {
|
||||
NodeKind::Group { .. } | NodeKind::Layer { .. } => effects::pinned_container_appearance(doc, n),
|
||||
NodeKind::Path { guide: false, .. } | NodeKind::Compound { .. } => pinned_shape(doc, n),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn rasterizes(fx: &[Effect]) -> bool {
|
||||
fx.iter().any(|effect| effect.visible && effect.id == effects::RASTERIZE)
|
||||
}
|
||||
|
||||
fn unsupported(n: &Node) -> bool {
|
||||
effects::has_plugin_effect(n)
|
||||
|| rasterizes(&n.appearance.effects)
|
||||
|| n.appearance.items.iter().any(|item| {
|
||||
item.visible() && (rasterizes(item.effects()) || matches!(item, AppearanceItem::Stroke(stroke) if stroke.path_gradient().is_some()))
|
||||
})
|
||||
}
|
||||
|
||||
fn unplaced(item: &AppearanceItem) -> bool {
|
||||
item.visible() && matches!(item.paint(), Paint::Gradient(gradient) if !gradient.is_placed())
|
||||
}
|
||||
|
||||
fn pinned_shape(doc: &Document, n: &Node) -> Option<Appearance> {
|
||||
let bp = node_bezpath(n)?;
|
||||
let (geometry, object_carry) = effected_path_carrying(doc, n, &bp);
|
||||
if geometry.elements().is_empty() {
|
||||
return None;
|
||||
}
|
||||
// Share the renderer's actual temporary object carry and skipped-effect flags.
|
||||
let temporary = carried(n, &object_carry);
|
||||
let paints = temporary.as_deref().unwrap_or(n);
|
||||
let context = GeomContext { doc: Some(doc), ..GeomContext::of(paints) };
|
||||
let mut appearance = (*n.appearance).clone();
|
||||
let mut changed = false;
|
||||
for (index, original) in n.appearance.items.iter().enumerate().filter(|(_, item)| unplaced(item)) {
|
||||
// `item` must belong to the same temporary appearance borrowed by `context.item`:
|
||||
// that lookup uses pointer identity to recover the actual row index/seed.
|
||||
let item = paints.appearance.items.get(index)?;
|
||||
let (item_geometry, item_carry) = apply_carrying(item_effects(item), &geometry, &context.item(item));
|
||||
let bounds = item_bounds(item, &geometry, &item_geometry, &item_carry)?;
|
||||
if let Some(pinned) = effects::pinned_gradient_item(original, bounds, &[&object_carry, &item_carry]) {
|
||||
*appearance.items.get_mut(index)? = pinned;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
changed.then_some(appearance)
|
||||
}
|
||||
|
||||
/// The same temporary item carry/skipped flags and `ib` choice as `Renderer::paint_items`.
|
||||
fn item_bounds(item: &AppearanceItem, geometry: &BezPath, item_geometry: &BezPath, carry: &effects::Carry) -> Option<Rect> {
|
||||
let mut appearance = Appearance { items: vec![item.clone()], ..Default::default() };
|
||||
if !carry.is_empty() && matches!(item.paint(), Paint::Gradient(_)) {
|
||||
carry.apply(&mut appearance);
|
||||
}
|
||||
let mut item = appearance.items.pop()?;
|
||||
if carry.skipped() {
|
||||
carry.hide_skipped(item.effects_mut());
|
||||
}
|
||||
Some(if effects::has_geometry(item_effects(&item)) && !item_geometry.elements().is_empty() {
|
||||
item_geometry.bounding_box()
|
||||
} else {
|
||||
geometry.bounding_box()
|
||||
})
|
||||
}
|
||||
@@ -25,11 +25,20 @@ pub(crate) fn has_fx(n: &Node) -> bool {
|
||||
/// effect copies it with a gradient or changes its fills and strokes ([`effects::has_transform_art`]),
|
||||
/// or is it a group or layer with an appearance of its own (see [`Renderer::draw_object_fx`])?
|
||||
pub(crate) fn has_object_fx(n: &Node) -> bool {
|
||||
object_fx(n, true)
|
||||
}
|
||||
|
||||
/// The alternate-art dispatches other than a group or layer's own container appearance.
|
||||
pub(super) fn has_non_container_art_fx(n: &Node) -> bool {
|
||||
object_fx(n, false)
|
||||
}
|
||||
|
||||
fn object_fx(n: &Node, containers: bool) -> bool {
|
||||
(effects::needs_outline(n) && (visible(&n.appearance.effects) || n.projection().is_some()))
|
||||
|| effects::has_item_geometry(n)
|
||||
|| effects::has_instance_row_raster(n)
|
||||
|| effects::has_transform_art(n)
|
||||
|| effects::has_container_appearance(n)
|
||||
|| (containers && effects::has_container_appearance(n))
|
||||
|| effects::has_crop_marks(n)
|
||||
|| effects::addons::halftone::has_halftone(n)
|
||||
|| effects::has_adjustment(n)
|
||||
|
||||
@@ -1029,7 +1029,7 @@ impl Renderer {
|
||||
/// the Transform effects the geometry pass left out hidden ([`effects::Carry::hide_skipped`]), so
|
||||
/// its raster effects and those of its fills and strokes stay with its art; `None` when it stays
|
||||
/// as it is.
|
||||
fn carried(n: &Node, carry: &effects::Carry) -> Option<Arc<Node>> {
|
||||
pub(super) fn carried(n: &Node, carry: &effects::Carry) -> Option<Arc<Node>> {
|
||||
let moves = carry.moves(&n.appearance);
|
||||
(moves || carry.skipped()).then(|| {
|
||||
let mut m = n.clone();
|
||||
|
||||
@@ -43,6 +43,7 @@ use lru::FrameCache;
|
||||
pub use brush_fx::instance_art;
|
||||
pub use changed::{Changed, changed, placed_area, view_pixels};
|
||||
pub use effects::stroke::width_outline;
|
||||
pub use fx::pinned_appearance_for_geometry_edit;
|
||||
pub use images::{IMAGE_CACHE_MAX, image_cache_bytes, installed_memory, newly_undecodable, set_image_cache_budget};
|
||||
pub use live::expand_live;
|
||||
pub use pattern::render_pattern_swatch;
|
||||
|
||||
@@ -9,6 +9,8 @@ description = "VectorCraft text: font database, shaping, layout, glyph outlines"
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
# The shared font catalog from craft-libs main (it has the outline, bidi and caret helpers used here).
|
||||
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "23acc704933a9a5619a5cd1cddc9bb1fb5a9b2d3", default-features = false }
|
||||
vectorcraft-geom = { workspace = true }
|
||||
vectorcraft-doc = { workspace = true }
|
||||
kurbo = { workspace = true }
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::sync::{Arc, Mutex, RwLock};
|
||||
|
||||
use kurbo::BezPath;
|
||||
use skrifa::instance::{Location, LocationRef, Size};
|
||||
use skrifa::outline::{DrawSettings, OutlinePen};
|
||||
use skrifa::outline::OutlinePen;
|
||||
use skrifa::raw::FileRef;
|
||||
use skrifa::string::StringId;
|
||||
use skrifa::{GlyphId, MetadataProvider, Tag};
|
||||
|
||||
@@ -53,6 +53,25 @@ impl OutlinePen for FlipPen {
|
||||
}
|
||||
}
|
||||
|
||||
// Share font decoding while preserving the app's existing y-down geometry and resource budget.
|
||||
impl craft_font_catalog::GlyphPen for FlipPen {
|
||||
fn move_to(&mut self, x: f32, y: f32) {
|
||||
OutlinePen::move_to(self, x, y);
|
||||
}
|
||||
fn line_to(&mut self, x: f32, y: f32) {
|
||||
OutlinePen::line_to(self, x, y);
|
||||
}
|
||||
fn quad_to(&mut self, x1: f32, y1: f32, x: f32, y: f32) {
|
||||
OutlinePen::quad_to(self, x1, y1, x, y);
|
||||
}
|
||||
fn curve_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32) {
|
||||
OutlinePen::curve_to(self, x1, y1, x2, y2, x, y);
|
||||
}
|
||||
fn close(&mut self) {
|
||||
OutlinePen::close(self);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -10,10 +10,7 @@ use super::names::{norm, norm_chars, script_families};
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use super::scan::{enumerate_faces, font_files};
|
||||
use super::traits::{Alias, FontMatch, FontTraits, regular_rank};
|
||||
use super::{
|
||||
Arc, BezPath, CANONICAL_CACHE_MAX, Color, ColourContent, DrawSettings, FontDb, GlyphId, GlyphImage, MetadataProvider, NEXT_ID, OUTLINE_CACHE_MAX,
|
||||
Ordering, Size,
|
||||
};
|
||||
use super::{Arc, BezPath, CANONICAL_CACHE_MAX, Color, ColourContent, FontDb, GlyphImage, MetadataProvider, NEXT_ID, OUTLINE_CACHE_MAX, Ordering};
|
||||
|
||||
/// The most faces [`FontDb::postscript_faces`] gives, and the most families it loads.
|
||||
const MAX_POSTSCRIPT_FACES: usize = 16;
|
||||
@@ -655,10 +652,9 @@ impl FontDb {
|
||||
return p.clone();
|
||||
}
|
||||
let mut pen = FlipPen(BezPath::new());
|
||||
if let Some(f) = face.skrifa()
|
||||
&& let Some(g) = f.outline_glyphs().get(GlyphId::new(gid))
|
||||
{
|
||||
let _ = g.draw(DrawSettings::unhinted(Size::unscaled(), face.location()), &mut pen);
|
||||
if let Ok(font) = craft_font_catalog::FontOutline::from_bytes(face.data(), face.index(), face.variations()) {
|
||||
// As before, keep the prefix emitted before a malformed glyph reports an error.
|
||||
let _ = font.draw_to(gid, &mut pen);
|
||||
}
|
||||
let p = Arc::new(pen.0);
|
||||
let mut cache = self.outlines.lock().unwrap_or_else(|e| e.into_inner());
|
||||
@@ -722,3 +718,89 @@ impl FontDb {
|
||||
content
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod shared_outline_tests {
|
||||
use super::super::glyph_pen::FlipPen;
|
||||
use super::*;
|
||||
use skrifa::instance::Size;
|
||||
use skrifa::outline::DrawSettings;
|
||||
use skrifa::{GlyphId, MetadataProvider};
|
||||
|
||||
#[test]
|
||||
fn shared_outlines_match_original_pen_for_variable_instances() {
|
||||
let db = FontDb::with_font_dirs(vec![]);
|
||||
let Some(bytes) = crate::test_fonts::variable_font() else { return };
|
||||
assert!(db.add_font(bytes) > 0);
|
||||
let face = db.face(crate::test_fonts::VARIABLE_FAMILY, "Bold").expect("named instance is registered");
|
||||
let f = face.skrifa().expect("font parses");
|
||||
for ch in ['A', 'V', ' ', 'a'] {
|
||||
let Some(glyph) = f.charmap().map(ch) else { continue };
|
||||
let mut old = FlipPen(BezPath::new());
|
||||
if let Some(outline) = f.outline_glyphs().get(GlyphId::new(glyph.to_u32())) {
|
||||
// Match the prior production behavior, including a partial path on error.
|
||||
let _ = outline.draw(DrawSettings::unhinted(Size::unscaled(), face.location()), &mut old);
|
||||
}
|
||||
assert_eq!(*db.outline(&face, glyph.to_u32()), old.0, "glyph {ch}");
|
||||
}
|
||||
}
|
||||
|
||||
// Generated CFF keeps the differential tests independent of installed fonts.
|
||||
fn cff_font(program: &[u8]) -> Vec<u8> {
|
||||
let mut cff = vec![1, 0, 4, 4, 0, 1, 1, 1, 2, b'X', 0, 1, 1, 1, 7, 29, 0, 0, 0, 25, 17, 0, 0, 0, 0];
|
||||
cff.extend_from_slice(&[0, 1, 4]);
|
||||
cff.extend_from_slice(&1u32.to_be_bytes());
|
||||
cff.extend_from_slice(&((program.len() as u32) + 1).to_be_bytes());
|
||||
cff.extend_from_slice(program);
|
||||
let mut builder = write_fonts::FontBuilder::new();
|
||||
let mut head = vec![0; 54];
|
||||
head[18..20].copy_from_slice(&1000u16.to_be_bytes());
|
||||
let mut hhea = vec![0; 36];
|
||||
hhea[34..36].copy_from_slice(&1u16.to_be_bytes());
|
||||
for (tag, data) in [(b"head", head), (b"hhea", hhea), (b"hmtx", vec![0, 100, 0, 0]), (b"maxp", vec![0, 0, 0x50, 0, 0, 1]), (b"CFF ", cff)] {
|
||||
builder.add_raw(write_fonts::types::Tag::new(tag), data);
|
||||
}
|
||||
builder.build()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn malformed_cff_prefix_matches_original_pen() {
|
||||
let bytes = cff_font(&[139, 139, 21, 239, 139, 5, 10, 14]);
|
||||
let gid = 0;
|
||||
let f = skrifa::FontRef::new(&bytes).unwrap();
|
||||
let mut old = FlipPen(BezPath::new());
|
||||
let result = f
|
||||
.outline_glyphs()
|
||||
.get(GlyphId::new(gid))
|
||||
.unwrap()
|
||||
.draw(DrawSettings::unhinted(Size::unscaled(), skrifa::instance::LocationRef::default()), &mut old);
|
||||
assert!(result.is_err());
|
||||
assert!(!old.0.elements().is_empty());
|
||||
let shared = craft_font_catalog::FontOutline::from_bytes(&bytes, 0, &[]).unwrap();
|
||||
let mut streamed = FlipPen(BezPath::new());
|
||||
assert!(shared.draw_to(gid, &mut streamed).is_err());
|
||||
assert_eq!(streamed.0, old.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn large_valid_outline_matches_original_pen() {
|
||||
let mut program = vec![139, 139, 21];
|
||||
for _ in 0..100_001 {
|
||||
program.extend_from_slice(&[140, 6]);
|
||||
}
|
||||
program.push(14);
|
||||
let bytes = cff_font(&program);
|
||||
let f = skrifa::FontRef::new(&bytes).unwrap();
|
||||
let mut old = FlipPen(BezPath::new());
|
||||
f.outline_glyphs()
|
||||
.get(GlyphId::new(0))
|
||||
.unwrap()
|
||||
.draw(DrawSettings::unhinted(Size::unscaled(), skrifa::instance::LocationRef::default()), &mut old)
|
||||
.unwrap();
|
||||
assert!(old.0.elements().len() > 100_000);
|
||||
let shared = craft_font_catalog::FontOutline::from_bytes(&bytes, 0, &[]).unwrap();
|
||||
let mut streamed = FlipPen(BezPath::new());
|
||||
shared.draw_to(0, &mut streamed).unwrap();
|
||||
assert_eq!(streamed.0, old.0);
|
||||
}
|
||||
}
|
||||
+16
-24
@@ -62,30 +62,22 @@ fn continues_cluster(prev: Option<&SGlyph>, g: Option<&SGlyph>) -> bool {
|
||||
/// ([`upright_extent`]) as a share of `upright`, the length in font units its own width runs down.
|
||||
/// Empty for a glyph of one character.
|
||||
fn ligature_carets(text: &str, g: &SGlyph, rtl: bool, upright: Option<f64>) -> Vec<(usize, f64)> {
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
let Some(s) = text.get(g.byte..g.byte + g.len).filter(|_| g.len > 1) else { return Vec::new() };
|
||||
let starts: Vec<usize> = s.grapheme_indices(true).skip(1).map(|(i, _)| g.byte + i).collect();
|
||||
if starts.is_empty() {
|
||||
return Vec::new();
|
||||
}
|
||||
let parts = starts.len() + 1;
|
||||
let from_font = if let Some(length) = upright {
|
||||
let (cell, top) = upright_extent(g);
|
||||
g.face
|
||||
.vertical_ligature_carets(g.gid, starts.len(), top, cell)
|
||||
.filter(|c| c.len() == starts.len() && length > 0.0)
|
||||
.map(|c| c.into_iter().map(|d| d / length).collect::<Vec<f64>>())
|
||||
.filter(|c| c.iter().all(|f| *f > 0.0 && *f < 1.0))
|
||||
} else {
|
||||
let advance = g.face.advance(g.gid);
|
||||
g.face
|
||||
.ligature_carets(g.gid, starts.len())
|
||||
.filter(|c| c.len() == starts.len() && advance > 0.0)
|
||||
.map(|c| c.into_iter().map(|x| if rtl { 1.0 - x / advance } else { x / advance }).collect::<Vec<f64>>())
|
||||
};
|
||||
let mut at = from_font.unwrap_or_else(|| (1..parts).map(|j| j as f64 / parts as f64).collect());
|
||||
at.sort_by(f64::total_cmp);
|
||||
starts.into_iter().zip(at).collect()
|
||||
craft_font_catalog::ligature_caret_stops(text, g.byte, g.len, |count| {
|
||||
if let Some(length) = upright {
|
||||
let (cell, top) = upright_extent(g);
|
||||
g.face
|
||||
.vertical_ligature_carets(g.gid, count, top, cell)
|
||||
.filter(|c| c.len() == count && length > 0.0)
|
||||
.map(|c| c.into_iter().map(|d| d / length).collect::<Vec<f64>>())
|
||||
.filter(|c| c.iter().all(|f| *f > 0.0 && *f < 1.0))
|
||||
} else {
|
||||
let advance = g.face.advance(g.gid);
|
||||
g.face
|
||||
.ligature_carets(g.gid, count)
|
||||
.filter(|c| c.len() == count && advance > 0.0)
|
||||
.map(|c| c.into_iter().map(|x| if rtl { 1.0 - x / advance } else { x / advance }).collect::<Vec<f64>>())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Does glyph `g`, standing upright in vertical type, take a cell of its own down the column? Every
|
||||
|
||||
@@ -81,34 +81,9 @@ pub(super) fn visual_order(bidi: Option<&BidiInfo<'_>>, paragraph_start: usize,
|
||||
return vec![];
|
||||
}
|
||||
let levels = bidi.reordered_levels(para, line.start.saturating_sub(paragraph_start)..line.end.saturating_sub(paragraph_start));
|
||||
// A list marker (length 0) is a cluster of its own.
|
||||
let mut clusters: Vec<Range<usize>> = Vec::new();
|
||||
for (i, g) in glyphs.iter().enumerate() {
|
||||
if i > 0 && glyphs.get(i - 1).is_some_and(|p| p.byte == g.byte && (p.len == 0) == (g.len == 0)) {
|
||||
if let Some(c) = clusters.last_mut() {
|
||||
c.end = i + 1;
|
||||
}
|
||||
} else {
|
||||
clusters.push(i..i + 1);
|
||||
}
|
||||
}
|
||||
// A list marker is at the paragraph's level, and at a right-to-left one its tab is drawn
|
||||
// before (left of) its characters.
|
||||
let cluster_levels: Vec<_> = clusters
|
||||
.iter()
|
||||
.filter_map(|c| glyphs.get(c.start))
|
||||
.map(|g| if g.len == 0 { g.level } else { levels.get(g.byte.saturating_sub(paragraph_start)).copied().unwrap_or(g.level) })
|
||||
.collect();
|
||||
let reversed = |i: usize| glyphs.get(clusters.get(i).map_or(0, |c| c.start)).is_some_and(|g| g.len == 0 && g.level.is_rtl());
|
||||
unicode_bidi::BidiInfo::reorder_visual(&cluster_levels)
|
||||
.into_iter()
|
||||
.filter_map(|i| clusters.get(i).map(|c| (c.clone(), reversed(i))))
|
||||
.flat_map(|(c, rev)| {
|
||||
let mut v: Vec<usize> = c.collect();
|
||||
if rev {
|
||||
v.reverse();
|
||||
}
|
||||
v
|
||||
})
|
||||
.collect()
|
||||
craft_font_catalog::visual_order(
|
||||
glyphs.iter().map(|g| craft_font_catalog::VisualGlyph { byte: g.byte, len: g.len, level: g.level }),
|
||||
paragraph_start,
|
||||
&levels,
|
||||
)
|
||||
}
|
||||
@@ -458,24 +458,8 @@ pub(super) fn break_line(
|
||||
line_end: &[f64],
|
||||
fits: Option<&dyn Fn(usize, bool) -> bool>,
|
||||
) -> (usize, bool) {
|
||||
// The line ending at `chosen`, once it holds a tab, when it fits as drawn; otherwise the latest
|
||||
// of the legal `breaks` before it that fits as drawn, measuring at most `checks` of them from
|
||||
// the latest back and bisecting the earlier ones without a hyphen; the first of them when none
|
||||
// of those measured fits.
|
||||
let settle = |tabbed: bool, checks: usize, chosen: (usize, bool), breaks: &[(usize, bool)]| -> (usize, bool) {
|
||||
let Some(fits) = fits.filter(|_| tabbed) else { return chosen };
|
||||
if fits(chosen.0, chosen.1) {
|
||||
return chosen;
|
||||
}
|
||||
let earlier = breaks.get(breaks.partition_point(|b| b.0 <= i)..breaks.partition_point(|b| b.0 < chosen.0)).unwrap_or_default();
|
||||
if let Some(&b) = earlier.iter().rev().take(checks).find(|b| fits(b.0, b.1)) {
|
||||
return b;
|
||||
}
|
||||
// Without a hyphen, a line that ends later is drawn no narrower, so those breaks bisect.
|
||||
let rest = earlier.get(..earlier.len().saturating_sub(checks)).unwrap_or_default();
|
||||
let plain: Vec<&(usize, bool)> = rest.iter().filter(|b| !b.1).collect();
|
||||
let fitting = plain.partition_point(|b| fits(b.0, b.1));
|
||||
fitting.checked_sub(1).and_then(|k| plain.get(k).copied()).or(earlier.first()).copied().unwrap_or(chosen)
|
||||
let settle = |tabbed: bool, checks: usize, chosen: (usize, bool), breaks: &[(usize, bool)]| {
|
||||
craft_font_catalog::settle_line_break(tabbed, checks, i, chosen, breaks, fits)
|
||||
};
|
||||
// How many breaks a line measures as drawn one by one.
|
||||
let checks = |back: f64| if back > 0.0 { MAX_DRAWN_CHECKS_STEPPING_BACK } else { MAX_DRAWN_CHECKS };
|
||||
|
||||
+35
-57
@@ -8,7 +8,7 @@ use unicode_bidi::Level;
|
||||
use unicode_script::{Script, UnicodeScript};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
|
||||
use harfrust::{BufferClusterLevel, Direction, Feature, ShapeOptions, Tag, UnicodeBuffer};
|
||||
use harfrust::{Direction, Feature, Tag};
|
||||
use kurbo::Shape;
|
||||
use skrifa::MetadataProvider;
|
||||
use skrifa::charmap::Charmap;
|
||||
@@ -673,7 +673,7 @@ pub(crate) fn shape_runs(
|
||||
// Split into segments by font coverage (and case, for Small Caps).
|
||||
let mut seg = Segment { db, range: a..a, runs, source_runs, st, face: primary.clone(), small: false, level: level_at(a) };
|
||||
let mut cache: std::collections::HashMap<&str, Arc<FontFace>> = std::collections::HashMap::new();
|
||||
let mut script = Script::Common;
|
||||
let mut boundary = craft_font_catalog::SegmentBoundary::new(primary.id(), level_at(a));
|
||||
// A grapheme cluster (a letter and its marks, an emoji sequence) is set in one face.
|
||||
for (i, cluster) in text[a..b].grapheme_indices(true) {
|
||||
let i = a + i;
|
||||
@@ -693,20 +693,16 @@ pub(crate) fn shape_runs(
|
||||
};
|
||||
let small = small_caps && c.is_lowercase();
|
||||
let next_script = shaping_script(c);
|
||||
let strong_script = !matches!(next_script, Script::Common | Script::Inherited);
|
||||
let script_change = strong_script && script != Script::Common && script != next_script;
|
||||
let strong_script = (!matches!(next_script, Script::Common | Script::Inherited)).then_some(next_script);
|
||||
// Combining marks, zero width joiners and non-joiners, and variation selectors stay
|
||||
// with the character before them.
|
||||
if (face.id() != seg.face.id() || small != seg.small || level != seg.level || script_change) && !is_mark(c) {
|
||||
if boundary.advance(face.id(), level, small, strong_script, is_mark(c)) {
|
||||
if i > seg.range.start {
|
||||
seg.range.end = i;
|
||||
shape_segment(text, &range, &seg, feats, out);
|
||||
}
|
||||
seg = Segment { range: i..i, face, small, level, ..seg };
|
||||
}
|
||||
if strong_script {
|
||||
script = next_script;
|
||||
}
|
||||
}
|
||||
if b > seg.range.start {
|
||||
seg.range.end = b;
|
||||
@@ -1301,10 +1297,7 @@ fn shapes_alike(a: &CharStyle, b: &CharStyle) -> bool {
|
||||
/// `digits`: not what the layout handles itself (tab, line and paragraph breaks), joiners or
|
||||
/// variation selectors.
|
||||
fn drawn_chars(cluster: &str, digits: Digits) -> impl Iterator<Item = char> + '_ {
|
||||
cluster
|
||||
.chars()
|
||||
.map(move |c| digits.map(c))
|
||||
.filter(|&c| !(c.is_control() || matches!(c, '\u{200C}' | '\u{200D}' | '\u{2028}' | '\u{FE00}'..='\u{FE0F}' | '\u{E0100}'..='\u{E01EF}')))
|
||||
craft_font_catalog::drawable_characters(cluster, move |c| digits.map(c))
|
||||
}
|
||||
|
||||
/// Does the face with charmap `map` have a glyph for `c` (any face does when it has no charmap)?
|
||||
@@ -1316,11 +1309,14 @@ fn in_face(map: Option<&Charmap<'_>>, c: char) -> bool {
|
||||
/// first fallback face with all of them, so that a letter's marks are shaped with it and attach to
|
||||
/// it (#4491); when there is none, the face its first character takes on its own.
|
||||
fn fallback_face(db: &FontDb, primary: &Arc<FontFace>, pmap: Option<&Charmap<'_>>, cluster: &str, digits: Digits) -> Arc<FontFace> {
|
||||
let fallback = |c| db.fallback_for_style(c, primary.id(), primary.weight, primary.italic);
|
||||
drawn_chars(cluster, digits)
|
||||
.find_map(|c| fallback(c).filter(|f| drawn_chars(cluster, digits).all(|c| f.covers(c))))
|
||||
.or_else(|| drawn_chars(cluster, digits).next().filter(|&c| !in_face(pmap, c)).and_then(fallback))
|
||||
.unwrap_or_else(|| primary.clone())
|
||||
craft_font_catalog::cluster_face(
|
||||
cluster,
|
||||
primary,
|
||||
|c| digits.map(c),
|
||||
|c| in_face(pmap, c),
|
||||
|c| db.fallback_for_style(c, primary.id(), primary.weight, primary.italic),
|
||||
|face, c| face.covers(c),
|
||||
)
|
||||
}
|
||||
|
||||
/// The script `c` is shaped in: Japanese and Chinese text mixes Han, Hiragana, Katakana and
|
||||
@@ -1606,46 +1602,28 @@ fn shape_segment(text: &str, context: &Range<usize>, seg: &Segment, feats: &OtFe
|
||||
let along_features = with_more(&|s| feats.resolve(s));
|
||||
// gid, cluster, x and y advance, x and y offset.
|
||||
let shape = |feats: &[Feature], direction: Direction| {
|
||||
let mut buf = UnicodeBuffer::new();
|
||||
for (i, c) in text_seg.char_indices() {
|
||||
let cl = (range.start + i) as u32;
|
||||
let c = st.digits.map(c);
|
||||
if upper {
|
||||
for u in c.to_uppercase() {
|
||||
buf.add(u, cl);
|
||||
}
|
||||
} else {
|
||||
buf.add(c, cl);
|
||||
}
|
||||
}
|
||||
buf.set_direction(direction);
|
||||
buf.guess_segment_properties();
|
||||
if char_level.get() {
|
||||
buf.set_cluster_level(BufferClusterLevel::Characters);
|
||||
}
|
||||
// The characters' language picks the font's forms for it (`locl`: Turkish keeps fi
|
||||
// apart and the dot on its i).
|
||||
if let Some(l) = &language {
|
||||
buf.set_language(l.clone());
|
||||
}
|
||||
// Harfrust keeps this Unicode context for joining/positional shaping, but does not emit
|
||||
// glyphs for it. This retains context at real style/font segmentation boundaries without
|
||||
// shaping across those boundaries or claiming cross-style ligatures/mark attachment.
|
||||
if let Some(pre) = text.get(context.start..range.start) {
|
||||
buf.set_pre_context(pre);
|
||||
}
|
||||
if let Some(post) = text.get(range.end..context.end) {
|
||||
buf.set_post_context(post);
|
||||
}
|
||||
// A buffer whose characters name no script reads as `UNKNOWN`: its plan has none.
|
||||
let script = Some(buf.script()).filter(|s| *s != harfrust::script::UNKNOWN);
|
||||
let plan = face.shape_plan(&shaper, buf.direction(), script, language.as_ref(), feats);
|
||||
let gb = shaper.shape(buf, ShapeOptions::new().features(feats).plan(Some(&plan)));
|
||||
gb.glyph_infos()
|
||||
.iter()
|
||||
.zip(gb.glyph_positions())
|
||||
.map(|(info, pos)| (info.glyph_id, info.cluster, pos.x_advance, pos.y_advance, pos.x_offset, pos.y_offset))
|
||||
.collect::<Vec<_>>()
|
||||
let input = craft_font_catalog::RunInput {
|
||||
text: text_seg,
|
||||
source_start: range.start,
|
||||
pre_context: text.get(context.start..range.start).unwrap_or_default(),
|
||||
post_context: text.get(range.end..context.end).unwrap_or_default(),
|
||||
direction,
|
||||
language: language.as_ref(),
|
||||
features: feats,
|
||||
character_clusters: char_level.get(),
|
||||
uppercase: upper,
|
||||
};
|
||||
craft_font_catalog::shape_run(
|
||||
&shaper,
|
||||
&input,
|
||||
|c| st.digits.map(c),
|
||||
|shaper, direction, script, language, features| face.shape_plan(shaper, direction, script, language, features),
|
||||
)
|
||||
// HarfRust clusters are u32; a run beyond that source offset cannot be represented.
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|g| (g.glyph_id, g.cluster, g.x_advance, g.y_advance, g.x_offset, g.y_offset))
|
||||
.collect::<Vec<_>>()
|
||||
};
|
||||
let along = if level.is_rtl() { Direction::RightToLeft } else { Direction::LeftToRight };
|
||||
*raw = shape(&along_features, along).into_iter().map(|(g, c, xa, _, xo, yo)| (g, c, xa, xo, yo)).collect();
|
||||
|
||||
@@ -134,7 +134,7 @@ impl Tool for EnclosingLassoTool {
|
||||
let symbols = cx.doc.symbol_boxes();
|
||||
let region = (points.len() >= 3).then(|| Region::new(polygon(&points, true))).flatten();
|
||||
let mut ids = if let Some(region) = region {
|
||||
enclosure_candidates(cx.doc, region.path.bounding_box(), cx.isolation, cx.outline)
|
||||
enclosure_candidates(cx.doc, region.path.bounding_box(), cx.isolation, cx.outline, !cx.guides)
|
||||
.into_iter()
|
||||
.filter(|id| cx.doc.node(*id).is_some_and(|n| node_inside(n, &symbols, ®ion)))
|
||||
.collect()
|
||||
|
||||
@@ -76,6 +76,12 @@ pub struct DimensionTool {
|
||||
/// for that click (a snap or Shift can move the point away from it): placed with the pointer
|
||||
/// still at either, it is aligned.
|
||||
second: Option<(Point, Point)>,
|
||||
/// While a Linear dimension is placed with its line on the level of another dimension's line:
|
||||
/// the ends of that other line. A Smart Guide runs along the level across both lines.
|
||||
level_guide: Option<(Point, Point)>,
|
||||
/// While a dimension is placed: the lines of the visible, unlocked linear dimensions in the
|
||||
/// document before its first preview ([`dimension_lines`]), which its line can line up with.
|
||||
levels: Vec<DimensionLine>,
|
||||
}
|
||||
|
||||
/// What a linear dimension between `a` and `b` measures with the pointer at `p` while it is
|
||||
@@ -285,6 +291,58 @@ fn on_dimensions(cx: &ToolContext, p: Point) -> Option<(Point, bool)> {
|
||||
best.end.map(|(_, q)| (q, true)).or_else(|| best.line.map(|(_, q)| (q, false)))
|
||||
}
|
||||
|
||||
/// The line of a linear dimension already drawn: its ends and its direction.
|
||||
type DimensionLine = ((Point, Point), Vec2);
|
||||
|
||||
/// The lines of the visible, unlocked linear dimensions in the document. Bounded work, as in
|
||||
/// [`on_dimensions`].
|
||||
fn dimension_lines(cx: &ToolContext) -> Vec<DimensionLine> {
|
||||
fn visit(n: &Node, budget: &mut usize, out: &mut Vec<DimensionLine>) {
|
||||
if *budget == 0 || !n.visible || n.locked {
|
||||
return;
|
||||
}
|
||||
*budget -= 1;
|
||||
if let Some(d) = &n.extras().dimension {
|
||||
if d.mode == DimensionMode::Linear {
|
||||
out.push((d.line_ends(), d.direction()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
for c in n.children().into_iter().flatten().rev() {
|
||||
visit(c, budget, out);
|
||||
}
|
||||
}
|
||||
let (mut budget, mut out) = (20_000usize, vec![]);
|
||||
for n in cx.doc.layers.iter().rev() {
|
||||
visit(n, &mut budget, &mut out);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Where the line of the linear dimension `d`, placed through `p`, lands on the level of one of
|
||||
/// the `levels` that runs parallel to it, within `reach` of `p` across the line: the point to
|
||||
/// place `d` through, and the ends of that other line. The nearest level wins, then the line
|
||||
/// nearest `p` along it (none nearer than a line that `p` lies across).
|
||||
fn line_level(levels: &[DimensionLine], d: &Dimension, p: Point, reach: f64) -> Option<(Point, (Point, Point))> {
|
||||
if d.mode != DimensionMode::Linear {
|
||||
return None;
|
||||
}
|
||||
let (u, normal) = (d.direction(), d.normal());
|
||||
let mut best: Option<(f64, f64, f64, (Point, Point))> = None;
|
||||
for &(ends, direction) in levels {
|
||||
if u.cross(direction).abs() > 1e-6 {
|
||||
continue;
|
||||
}
|
||||
let shift = (ends.0 - p).dot(normal);
|
||||
let (s0, s1) = ((ends.0 - p).dot(u), (ends.1 - p).dot(u));
|
||||
let along = if s0 * s1 <= 0.0 { 0.0 } else { s0.abs().min(s1.abs()) };
|
||||
if shift.is_finite() && along.is_finite() && shift.abs() <= reach && best.is_none_or(|(s, a, _, _)| (shift.abs(), along) < (s, a)) {
|
||||
best = Some((shift.abs(), along, shift, ends));
|
||||
}
|
||||
}
|
||||
best.map(|(_, _, shift, ends)| (p + normal * shift, ends))
|
||||
}
|
||||
|
||||
/// The point of `edge` closest to `p`.
|
||||
fn nearest_on(cx: &ToolContext, edge: &SegmentRef, p: Point) -> Option<Point> {
|
||||
use vectorcraft_geom::kurbo::ParamCurveNearest;
|
||||
@@ -435,6 +493,7 @@ impl DimensionTool {
|
||||
p
|
||||
}
|
||||
fn preview(&mut self, cx: &ToolContext, p: Point) -> Vec<Action> {
|
||||
self.level_guide = None;
|
||||
let Some(d) = &mut self.pending else { return vec![] };
|
||||
if matches!(d.mode, DimensionMode::Radius | DimensionMode::Diameter)
|
||||
&& let Some(Target::Radial { center, radius, .. }) = self.press.as_ref().and_then(|(_, t)| t.as_ref())
|
||||
@@ -462,10 +521,18 @@ impl DimensionTool {
|
||||
if d.resolve(cx.doc).is_err() {
|
||||
return vec![];
|
||||
}
|
||||
d.place(p);
|
||||
// With Smart Guides on, a linear dimension's line lands on the level of a parallel
|
||||
// dimension line already drawn within the Smart Guides snapping tolerance. The lines are
|
||||
// read before the first preview, so the preview of this dimension is not one of them.
|
||||
if !self.began {
|
||||
self.levels = dimension_lines(cx);
|
||||
}
|
||||
let level = if cx.smart_guides { line_level(&self.levels, d, p, cx.snap_tol()) } else { None };
|
||||
d.place(level.map_or(p, |(on_level, _)| on_level));
|
||||
if d.validate().is_err() {
|
||||
return vec![];
|
||||
}
|
||||
self.level_guide = level.map(|(_, ends)| ends);
|
||||
let mut actions = vec![];
|
||||
if !self.began {
|
||||
actions.push(Action::Begin("Create Dimension".into()));
|
||||
@@ -495,6 +562,8 @@ impl DimensionTool {
|
||||
self.snap.clear();
|
||||
self.snapped = None;
|
||||
self.second = None;
|
||||
self.level_guide = None;
|
||||
self.levels.clear();
|
||||
}
|
||||
/// A plain click: picks a point or a line, or measures a circle's radius.
|
||||
fn click(&mut self, cx: &ToolContext, p: Point, target: Option<Target>, mods: Mods) -> Vec<Action> {
|
||||
@@ -664,6 +733,7 @@ impl Tool for DimensionTool {
|
||||
self.press = None;
|
||||
if self.pending.is_some() && self.began {
|
||||
self.began = false;
|
||||
self.level_guide = None;
|
||||
vec![Action::Cancel]
|
||||
} else {
|
||||
vec![]
|
||||
@@ -741,6 +811,21 @@ impl Tool for DimensionTool {
|
||||
if linear_pick {
|
||||
out.extend(self.snap.guides().iter().cloned());
|
||||
}
|
||||
// A dimension line placed on the level of another: one alignment guide across both lines,
|
||||
// unless Alignment Guides are off.
|
||||
if cx.alignment_guides
|
||||
&& let (Some(d), Some((c, e))) = (&self.pending, self.level_guide)
|
||||
{
|
||||
let (a, b) = d.line_ends();
|
||||
let u = d.direction();
|
||||
let along = |q: &Point| q.to_vec2().dot(u);
|
||||
let ends = [a, b, c, e];
|
||||
if let (Some(lo), Some(hi)) =
|
||||
(ends.iter().min_by(|p, q| along(p).total_cmp(&along(q))), ends.iter().max_by(|p, q| along(p).total_cmp(&along(q))))
|
||||
{
|
||||
out.push(Overlay::Line { a: *lo, b: *hi, color: cx.smart_guide_color, dashed: false });
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
}
|
||||
@@ -778,6 +863,21 @@ mod tests {
|
||||
assert!(t.pointer(&c, &ev(PointerKind::Up, 150.0, 60.0)).is_empty(), "the release places nothing");
|
||||
}
|
||||
|
||||
/// Of two dimension lines on one level, a line the pointer lies across wins over a line whose
|
||||
/// end is nearer the pointer.
|
||||
#[test]
|
||||
fn a_line_the_pointer_lies_across_wins_on_one_level() {
|
||||
let pt = Point::new;
|
||||
let d = DimensionTool::default().recipe(DimensionMode::Linear, pt(200.0, 200.0), pt(300.0, 200.0), pt(250.0, 200.0), None);
|
||||
let across = ((pt(0.0, 170.0), pt(400.0, 170.0)), Vec2::new(1.0, 0.0));
|
||||
let beside = ((pt(100.0, 170.0), pt(200.0, 170.0)), Vec2::new(1.0, 0.0));
|
||||
for levels in [[beside, across], [across, beside]] {
|
||||
let (at, ends) = line_level(&levels, &d, pt(250.0, 172.0), 4.0).expect("on the level");
|
||||
assert!(at.distance(pt(250.0, 170.0)) < 1e-9, "{at:?}");
|
||||
assert_eq!(ends, across.0);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_dropped_placement_press_does_not_commit_the_dimension() {
|
||||
let (d, _) = doc_with_rect();
|
||||
|
||||
@@ -1674,7 +1674,7 @@ impl DirectSelectionTool {
|
||||
// marquee or an Alt-marquee, every object it touches, each whole (#8047).
|
||||
if enclosed || whole || self.group {
|
||||
(self.spine, self.spine_more) = (None, vec![]);
|
||||
let mut touched = vectorcraft_doc::hit::marquee_in_view(cx.doc, r, cx.isolation, true, cx.outline);
|
||||
let mut touched = vectorcraft_doc::hit::marquee_in_view(cx.doc, r, cx.isolation, true, cx.outline, !cx.guides);
|
||||
let editable = cx.doc.editable();
|
||||
touched.retain(|id| editable(*id));
|
||||
let picked = if enclosed { crate::select::inside(cx, r, touched) } else { touched };
|
||||
@@ -1684,8 +1684,11 @@ impl DirectSelectionTool {
|
||||
}
|
||||
// Anchors inside the rect, on editable paths inside isolation mode.
|
||||
let mut sel: Vec<(NodeId, Vec<AnchorRef>)> = vec![];
|
||||
// Guide paths only while guides can be picked: not while they are locked or hidden (#8538).
|
||||
walk_pickable(cx.doc, cx.isolation, |n| {
|
||||
if let NodeKind::Path { path, .. } = &n.kind {
|
||||
if let NodeKind::Path { path, guide, .. } = &n.kind
|
||||
&& (cx.guides || !*guide)
|
||||
{
|
||||
let v: Vec<AnchorRef> = path.anchors().filter(|(_, _, a)| r.contains(a.p)).map(|(s, i, _)| (s, i)).collect();
|
||||
if !v.is_empty() {
|
||||
sel.push((n.id, v));
|
||||
@@ -1773,7 +1776,7 @@ impl DirectSelectionTool {
|
||||
}
|
||||
// Objects without anchors to pick (type, images, symbols…) are selected whole when
|
||||
// the marquee touches them, as with the Selection tool (#927).
|
||||
for id in vectorcraft_doc::hit::marquee_in_view(cx.doc, r, cx.isolation, true, cx.outline) {
|
||||
for id in vectorcraft_doc::hit::marquee_in_view(cx.doc, r, cx.isolation, true, cx.outline, !cx.guides) {
|
||||
let whole = cx.doc.node(id).is_some_and(|n| !matches!(n.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }));
|
||||
if whole && !sel.iter().any(|(s, _)| *s == id) && !framed.iter().any(|(f, _)| *f == id) && !meshed.contains(&id) && spined != Some(id) {
|
||||
sel.push((id, vec![]));
|
||||
@@ -1785,7 +1788,8 @@ impl DirectSelectionTool {
|
||||
let mut crossed: Vec<(NodeId, Vec<AnchorRef>)> = vec![];
|
||||
if !self.group {
|
||||
walk_pickable(cx.doc, cx.isolation, |n| {
|
||||
if let NodeKind::Path { path, .. } = &n.kind
|
||||
if let NodeKind::Path { path, guide, .. } = &n.kind
|
||||
&& (cx.guides || !*guide)
|
||||
&& editable(n.id)
|
||||
{
|
||||
let segs = crossed_segments(path, r);
|
||||
|
||||
@@ -2767,3 +2767,30 @@ fn outline_view_marquees_measure_clipped_art_by_the_plain_clipping_path() {
|
||||
let a = marquee(false);
|
||||
assert!(!selects(&a), "preview: {a:?}");
|
||||
}
|
||||
|
||||
/// #8538: while guides are locked or hidden (`guides` off), a Direct Selection marquee takes
|
||||
/// neither the anchors nor the crossed segments of a guide path; while guides can be picked, it
|
||||
/// takes them as on any path.
|
||||
#[test]
|
||||
fn a_marquee_skips_the_anchors_and_segments_of_guides_that_cannot_be_picked() {
|
||||
let (mut d, id) = doc_with_rect();
|
||||
if let Some(NodeKind::Path { guide, .. }) = d.node_mut(id).map(|n| &mut n.kind) {
|
||||
*guide = true;
|
||||
}
|
||||
let (s, p) = (Selection::default(), paint());
|
||||
let marquee = |guides: bool, from: (f64, f64), to: (f64, f64)| {
|
||||
let cx = ToolContext { guides, ..cx(&d, &s, &p) };
|
||||
let mut t = DirectSelectionTool::new(false);
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Down, from.0, from.1));
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, to.0, to.1));
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Up, to.0, to.1))
|
||||
};
|
||||
let anchors = |items: Value| vec![Action::Exec("select.anchorsMany".into(), json!({"items": items, "mode": "set"}))];
|
||||
// Over the corner at (200, 100).
|
||||
assert_eq!(marquee(false, (150.0, 50.0), (250.0, 150.0)), anchors(json!([])), "locked or hidden: no anchor");
|
||||
assert_eq!(marquee(true, (150.0, 50.0), (250.0, 150.0)), anchors(json!([{"id": id.0, "anchors": [[0, 1]]}])), "shown and unlocked");
|
||||
// Across the middle of the top edge.
|
||||
let crossed = |a: &[Action]| a.iter().any(|a| matches!(a, Action::Exec(c, _) if c == "select.segments"));
|
||||
assert!(!crossed(&marquee(false, (140.0, 80.0), (160.0, 120.0))), "locked or hidden: no segment");
|
||||
assert!(crossed(&marquee(true, (140.0, 80.0), (160.0, 120.0))), "shown and unlocked");
|
||||
}
|
||||
@@ -525,10 +525,12 @@ impl Tool for PenTool {
|
||||
&& let (Some((id, _, _, last, out)), Some(h)) = (self.active(cx), self.hover)
|
||||
{
|
||||
if cx.pen_rubber_band {
|
||||
// The segment a click at `h` adds: it leaves the last anchor along its outgoing
|
||||
// handle and arrives at the new corner anchor without a handle.
|
||||
let mut bp = BezPath::new();
|
||||
bp.move_to(last);
|
||||
if out.distance(last) > 1e-9 {
|
||||
bp.quad_to(out, h);
|
||||
bp.curve_to(out, h, h);
|
||||
} else {
|
||||
bp.line_to(h);
|
||||
}
|
||||
|
||||
@@ -865,6 +865,27 @@ fn anchors_snap_to_smart_guides() {
|
||||
assert_eq!(a[1], Action::Preview("path.create".into(), json!({"anchors": [{"x": 100.0, "y": 100.0}]})));
|
||||
}
|
||||
|
||||
/// The rubber band after a smooth anchor is the curve the click then adds: it leaves along the
|
||||
/// anchor's outgoing handle and arrives at the new corner anchor without a handle, so the segment
|
||||
/// keeps its shape when the anchor goes down (#8296).
|
||||
#[test]
|
||||
fn rubber_band_is_the_segment_a_click_adds() {
|
||||
let (last, out) = (Point::new(60.0, 300.0), Point::new(110.0, 250.0));
|
||||
let sub = vectorcraft_geom::SubPath::new(vec![Anchor::corner(Point::new(10.0, 300.0)), Anchor::smooth(last, out)], false);
|
||||
let (d, id, s) = drawing(sub);
|
||||
let p = paint();
|
||||
let cx = ToolContext { zoom: 1.0, smart_guides: false, snap_to_point: false, snap_to_pixel: false, snap_to_grid: false, ..cx(&d, &s, &p) };
|
||||
let h = Point::new(237.0, 361.0);
|
||||
let mut t = PenTool { drawing: true, ..PenTool::default() };
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Move, h.x, h.y));
|
||||
let band: Vec<_> =
|
||||
t.overlays(&cx).into_iter().filter_map(|o| if let Overlay::Path { path, .. } = o { Some(path.elements().to_vec()) } else { None }).collect();
|
||||
assert_eq!(band, vec![vec![vectorcraft_geom::PathEl::MoveTo(last), vectorcraft_geom::PathEl::CurveTo(out, h, h)]]);
|
||||
// The click adds a corner anchor there: the segment drawn is the one previewed.
|
||||
let a = click(&mut t, &cx, h.x, h.y, Mods::default());
|
||||
assert_eq!(a[1], Action::Preview("path.appendAnchor".into(), json!({"id": id.0, "x": h.x, "y": h.y, "subpath": 0})));
|
||||
}
|
||||
|
||||
/// With Enable Rubber Band off, the preview segment is hidden but Measurement Labels still shows
|
||||
/// the D / Angle / dX / dY readout at the snapped point before the next click.
|
||||
#[test]
|
||||
|
||||
@@ -596,7 +596,12 @@ fn with_object_bounds<R>(cx: &ToolContext, walk: impl FnOnce(&mut dyn FnMut(Node
|
||||
pub(crate) fn inside(cx: &ToolContext, r: Rect, ids: Vec<NodeId>) -> Vec<NodeId> {
|
||||
let symbols = cx.doc.symbol_boxes();
|
||||
let within = |b: Rect| r.min_x() <= b.min_x() && b.max_x() <= r.max_x() && r.min_y() <= b.min_y() && b.max_y() <= r.max_y();
|
||||
ids.into_iter().filter(|id| cx.doc.node(*id).and_then(|n| n.geometric_bounds_with(&symbols)).is_some_and(within)).collect()
|
||||
// Locked or hidden guides, which the marquee leaves out, don't count toward a group's box (#8538).
|
||||
let measure = |n: &vectorcraft_doc::Node| match n.without_guides().filter(|_| !cx.guides) {
|
||||
Some(art) => art.geometric_bounds_with(&symbols),
|
||||
None => n.geometric_bounds_with(&symbols),
|
||||
};
|
||||
ids.into_iter().filter(|id| cx.doc.node(*id).and_then(measure).is_some_and(within)).collect()
|
||||
}
|
||||
|
||||
/// What of the bounding box is under the pointer.
|
||||
@@ -1199,7 +1204,7 @@ impl Tool for SelectionTool {
|
||||
if r.width() < Self::drag_threshold(cx) && r.height() < Self::drag_threshold(cx) {
|
||||
return if toggle { vec![] } else { vec![Action::Exec("select.none".into(), json!({}))] };
|
||||
}
|
||||
let touched = marquee_in_view(cx.doc, r, cx.isolation, false, cx.outline);
|
||||
let touched = marquee_in_view(cx.doc, r, cx.isolation, false, cx.outline, !cx.guides);
|
||||
let enclosed = marquee_enclosed(cx, enclosed, marquee_direction(cx, start, p, directional_inside));
|
||||
let ids = if enclosed { inside(cx, r, touched) } else { touched };
|
||||
let art = Action::Exec(if toggle { "select.toggle" } else { "select.set" }.into(), json!({ "ids": json_ids(&ids) }));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::*;
|
||||
use crate::testutil::*;
|
||||
use vectorcraft_doc::Selection;
|
||||
use vectorcraft_doc::{Document, NodeKind, Selection};
|
||||
|
||||
/// While an opacity mask is edited, a press on a selected Shaper original shape moves it, over the
|
||||
/// art the group shows and over a part of the shape the group does not show. A press on an original
|
||||
@@ -146,6 +146,66 @@ fn a_press_where_a_mask_hides_a_selected_object_drags_it() {
|
||||
assert!(a.iter().any(|a| matches!(a, Action::Exec(c, v) if c == "select.set" && v["ids"] == json!([front.0]))), "{a:?}");
|
||||
}
|
||||
|
||||
/// #8538: while guides are locked or hidden (`guides` off), a Selection tool marquee that touches
|
||||
/// only a guide path in a group selects nothing, so a drag can't move the guide; one that touches
|
||||
/// the group's other member selects the group. With guides unlocked, the guide takes the group.
|
||||
#[test]
|
||||
fn a_marquee_over_a_locked_guide_in_a_group_selects_nothing() {
|
||||
let mut d = Document::new(800.0, 600.0);
|
||||
let l = d.layers[0].id;
|
||||
let (gid, guide_id, art_id) = (d.alloc_id(), d.alloc_id(), d.alloc_id());
|
||||
let mut guide = vectorcraft_doc::Node::path(
|
||||
guide_id,
|
||||
vectorcraft_geom::shapes::rectangle(Rect::new(100.0, 100.0, 120.0, 120.0)),
|
||||
vectorcraft_doc::Appearance::default_art(),
|
||||
);
|
||||
if let NodeKind::Path { guide, .. } = &mut guide.kind {
|
||||
*guide = true;
|
||||
}
|
||||
let art = vectorcraft_doc::Node::path(
|
||||
art_id,
|
||||
vectorcraft_geom::shapes::rectangle(Rect::new(300.0, 100.0, 320.0, 120.0)),
|
||||
vectorcraft_doc::Appearance::default_art(),
|
||||
);
|
||||
d.insert(Some(l), 0, vectorcraft_doc::Node::group(gid, vec![std::sync::Arc::new(guide), std::sync::Arc::new(art)])).unwrap();
|
||||
let (none, p) = (Selection::default(), paint());
|
||||
let marquee = |guides: bool, x0: f64, x1: f64| {
|
||||
let c = ToolContext { guides, ..cx(&d, &none, &p) };
|
||||
let mut t = SelectionTool::default();
|
||||
t.pointer(&c, &ev(PointerKind::Down, x0, 50.0));
|
||||
t.pointer(&c, &ev(PointerKind::Drag, x1, 110.0));
|
||||
let up = t.pointer(&c, &ev(PointerKind::Up, x1, 110.0));
|
||||
up.iter().find_map(|a| match a {
|
||||
Action::Exec(c, v) if c == "select.set" => Some(v["ids"].clone()),
|
||||
_ => None,
|
||||
})
|
||||
};
|
||||
assert_eq!(marquee(false, 90.0, 130.0), Some(json!([])), "locked: only the guide");
|
||||
assert_eq!(marquee(false, 290.0, 330.0), Some(json!([gid.0])), "locked: the group's art");
|
||||
assert_eq!(marquee(true, 90.0, 130.0), Some(json!([gid.0])), "unlocked: the guide");
|
||||
}
|
||||
|
||||
/// #8538: an enclosing marquee measures a group without the locked or hidden guides in it, as the
|
||||
/// marquee leaves them out: a group whose art lies inside is taken though a guide in it reaches
|
||||
/// past the marquee. While guides can be picked, the guide counts.
|
||||
#[test]
|
||||
fn an_enclosing_marquee_measures_a_group_without_its_locked_guides() {
|
||||
let mut d = Document::new(800.0, 600.0);
|
||||
let l = d.layers[0].id;
|
||||
let (gid, guide_id, art_id) = (d.alloc_id(), d.alloc_id(), d.alloc_id());
|
||||
let square = |id, r| vectorcraft_doc::Node::path(id, vectorcraft_geom::shapes::rectangle(r), vectorcraft_doc::Appearance::default_art());
|
||||
let mut guide = square(guide_id, Rect::new(500.0, 100.0, 520.0, 120.0));
|
||||
if let NodeKind::Path { guide, .. } = &mut guide.kind {
|
||||
*guide = true;
|
||||
}
|
||||
let art = square(art_id, Rect::new(100.0, 100.0, 120.0, 120.0));
|
||||
d.insert(Some(l), 0, vectorcraft_doc::Node::group(gid, vec![std::sync::Arc::new(guide), std::sync::Arc::new(art)])).unwrap();
|
||||
let (none, p) = (Selection::default(), paint());
|
||||
let r = Rect::new(50.0, 50.0, 200.0, 200.0);
|
||||
assert_eq!(crate::select::inside(&ToolContext { guides: false, ..cx(&d, &none, &p) }, r, vec![gid]), [gid], "locked or hidden");
|
||||
assert!(crate::select::inside(&ToolContext { guides: true, ..cx(&d, &none, &p) }, r, vec![gid]).is_empty(), "shown and unlocked");
|
||||
}
|
||||
|
||||
/// #955: grabbed by an anchor and dropped near another object's anchor, the anchor lands
|
||||
/// exactly on it with Smart Guides, even where lining the bounds up would leave it beside it.
|
||||
#[test]
|
||||
|
||||
@@ -329,3 +329,45 @@ fn common_tangents_previews_cancels_and_runs_on_ok() {
|
||||
assert_eq!((steps(&app), count(&app)), (n, nodes));
|
||||
assert!(app.ui.status.contains("inside the other"), "{}", app.ui.status);
|
||||
}
|
||||
|
||||
/// Common Tangents… on a point and an ellipse: every Tangents choice previews the same two lines
|
||||
/// from the point, OK keeps them as one step, and a point inside the ellipse changes nothing and
|
||||
/// says why.
|
||||
#[test]
|
||||
fn common_tangents_on_a_point_gives_the_same_lines_for_every_choice() {
|
||||
let mut app = app();
|
||||
let oval = app.run("shape.ellipse", json!({"x": 180.0, "y": 120.0, "width": 80.0, "height": 60.0})).unwrap()["id"].as_u64().unwrap();
|
||||
let point =
|
||||
|app: &mut VectorcraftApp, x: f64, y: f64| app.run("path.create", json!({"anchors": [{"x": x, "y": y}]})).unwrap()["id"].as_u64().unwrap();
|
||||
let dot = point(&mut app, 40.0, 150.0);
|
||||
app.run("select.set", json!({"ids": [oval, dot]})).unwrap();
|
||||
let steps = |app: &VectorcraftApp| app.session.doc().unwrap().history.undo.len();
|
||||
let count = |app: &VectorcraftApp| app.session.doc().unwrap().doc.node_count();
|
||||
let (n, nodes) = (steps(&app), count(&app));
|
||||
let open = |app: &mut VectorcraftApp| {
|
||||
let entries = menus::menu_entries(app);
|
||||
let item = entries.iter().find(|e| e.path == ["Object", "Plug-ins", "Path Precision Tools"] && e.label == "Common Tangents…").unwrap();
|
||||
assert!(item.enabled);
|
||||
let (cmd, p) = menus::click_target(&item.label, item.command.as_deref().unwrap(), &item.params);
|
||||
menus::invoke(app, &cmd, p);
|
||||
};
|
||||
|
||||
open(&mut app);
|
||||
crate::dialogs::set_field(app.ui.dialog.as_mut().unwrap(), "preview".into(), json!(true));
|
||||
for (_, kind) in super::TANGENT_KINDS {
|
||||
crate::dialogs::set_field(app.ui.dialog.as_mut().unwrap(), "tangents".into(), json!(kind));
|
||||
painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx()));
|
||||
assert_eq!(count(&app), nodes + 2, "{kind}: the two lines from the point");
|
||||
}
|
||||
crate::dialogs::confirm(&mut app).unwrap();
|
||||
assert_eq!((steps(&app), count(&app)), (n + 1, nodes + 2), "one undo step");
|
||||
|
||||
// A point inside the ellipse: nothing changes, and a message says why.
|
||||
let inside = point(&mut app, 220.0, 150.0);
|
||||
app.run("select.set", json!({"ids": [oval, inside]})).unwrap();
|
||||
let (n, nodes) = (steps(&app), count(&app));
|
||||
open(&mut app);
|
||||
crate::dialogs::confirm(&mut app).unwrap();
|
||||
assert_eq!((steps(&app), count(&app)), (n, nodes));
|
||||
assert!(app.ui.status.contains("The point lies inside the path"), "{}", app.ui.status);
|
||||
}
|
||||
@@ -1121,6 +1121,7 @@ pub(crate) fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
ui.add_space((middle - BUTTON / 2.0 * row.len() as f32 - ui.cursor().min.x).max(0.0));
|
||||
for &(s, slot) in row {
|
||||
let Some((rect, shown)) = slot_button(ui, &t, &press, slot, &mut actions) else { continue };
|
||||
crate::palette::note_spot(ui, rect, || crate::palette::SpotAt::Slot(Some(bar.name.clone()), slot.clone()));
|
||||
if edit_this {
|
||||
buttons.push((s, rect));
|
||||
}
|
||||
|
||||
@@ -547,8 +547,9 @@ fn hidden_controls(d: &Dialog) -> &'static [&'static str] {
|
||||
}
|
||||
// The selected rows and Randomize's seed.
|
||||
Some(DialogKind::Recolor) => &["__seed", "__sel"],
|
||||
// The view, zoom, download speed, selected color table entries and the preset name being typed.
|
||||
Some(DialogKind::SaveForWeb) => &["__color", "__colors", "__kbps", "__presetName", "__view", "__zoom"],
|
||||
// The view, zoom, download speed, selected color table entries, the color table entry whose
|
||||
// Color Picker opens and the preset name being typed.
|
||||
Some(DialogKind::SaveForWeb) => &["__color", "__colors", "__editColor", "__kbps", "__presetName", "__view", "__zoom"],
|
||||
// The link that keeps width and height in proportion.
|
||||
Some(DialogKind::Shape | DialogKind::TransformEach) => &["__constrain"],
|
||||
// The attention filter, the Keys section, the search text and the key being recorded.
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
//! as the web image Save writes, beside the original (Original, Optimized, 2-Up and 4-Up views,
|
||||
//! each with its file size and download time), and the settings: format (GIF, JPEG, PNG-8,
|
||||
//! PNG-24), colour reduction, colours, dither, transparency and matte, interlacing, web snap,
|
||||
//! lossy, JPEG quality, the colour table (lock, map to transparent, web shift, sort, Delete Color
|
||||
//! and Restore Generated Table), image size and anti-aliasing, Clip to Artboard, sRGB, metadata,
|
||||
//! lossy, JPEG quality, the colour table (lock, map to transparent, web shift, sort, Delete Color,
|
||||
//! Restore Generated Table, a double-click that shifts a color to one picked in the Color Picker,
|
||||
//! and Unshift All Colors), image size and anti-aliasing, Clip to Artboard, sRGB, metadata,
|
||||
//! slices and HTML output, and presets.
|
||||
//!
|
||||
//! Fields are the `document.exportForWeb` settings (`webExport.settings` gives them; set one with
|
||||
@@ -11,7 +12,8 @@
|
||||
//! `optimized`, `2up`, `4up`), `__zoom` (`fit` or a percentage), `__kbps` (connection speed),
|
||||
//! `__color` (the colour table's selected colour, by source: the one Lock, Transparent and Web
|
||||
//! Shift edit, and where a Shift-click range starts), `__colors` (every selected color, by source,
|
||||
//! which Delete Color deletes; when it is empty, `__color` alone), `__presetName` (shown while saving a
|
||||
//! which Delete Color deletes; when it is empty, `__color` alone), `__editColor` (a source color:
|
||||
//! the Color Picker opens on it, as a double-click on its swatch opens it), `__presetName` (shown while saving a
|
||||
//! preset) and `__hasSlices`. Optimize to File Size… (`__optimizeOpen: true`) shows `__optimizeK` (the desired size in K),
|
||||
//! `__optimizeStart` (`current`, `auto`) and with slices `__optimizeUse` (`allSlices`,
|
||||
//! `eachSlice`, `currentSlice`); `__optimizeGo: true` runs `webExport.optimizeToFileSize` and
|
||||
@@ -535,6 +537,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
take_shift(d);
|
||||
let settings = settings_of(app, d);
|
||||
let mut browser = false;
|
||||
// In a window too narrow for both, the panes are narrower, so the settings beside them and the
|
||||
@@ -565,6 +568,12 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
|
||||
if browser && let Err(e) = app.run("file.saveForWeb.browser", params(d)) {
|
||||
app.status(e);
|
||||
}
|
||||
// A double-clicked swatch (or an agent's `__editColor`) opens the Color Picker last, over the
|
||||
// dialog as it now is.
|
||||
if let Some(source) = d.fields.remove("__editColor").and_then(|v| v.as_str().map(String::from)) {
|
||||
let start = d.fields.remove("__editStart").and_then(|v| v.as_str().map(String::from)).unwrap_or_else(|| source.clone());
|
||||
edit_color(d, &source, &start);
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
@@ -1088,7 +1097,9 @@ fn matte_row(ui: &mut egui::Ui, d: &mut Dialog) {
|
||||
/// ones with a square, web-safe ones with a diamond, transparent ones over the grid), the buttons
|
||||
/// that edit the selected colour, Delete Color and the table's menu, plus the sort order. A click
|
||||
/// selects one color, a Shift-click the colors from the anchor, and a Ctrl-click
|
||||
/// (Command-click on macOS) adds or removes one. Returns an error for a deletion that would leave
|
||||
/// (Command-click on macOS) adds or removes one; a double-click on an opaque color asks for the
|
||||
/// Color Picker (`__editColor`), and a color shifted by hand shows its source color at the upper
|
||||
/// left and its new color at the lower right. Returns an error for a deletion that would leave
|
||||
/// no color.
|
||||
fn color_table(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) -> Result<(), String> {
|
||||
let t = Tokens::get(ui.ctx());
|
||||
@@ -1117,15 +1128,20 @@ fn color_table(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) -> Re
|
||||
.colors
|
||||
.iter()
|
||||
.map(|c| (*c, false))
|
||||
.chain(shot.mapped.iter().map(|c| (TableColor { color: *c, source: *c, transparent: true, locked: false, web_shifted: false }, true)))
|
||||
.chain(
|
||||
shot.mapped
|
||||
.iter()
|
||||
.map(|c| (TableColor { color: *c, source: *c, transparent: true, locked: false, web_shifted: false, shifted: false }, true)),
|
||||
)
|
||||
.collect();
|
||||
const CELL: f32 = 15.0;
|
||||
let per_row = ((SIDE_W - 8.0) / (CELL + 2.0)).floor().max(1.0) as usize;
|
||||
let lines = rows.len().div_ceil(per_row).max(1);
|
||||
let (area, resp) = ui.allocate_exact_size(egui::vec2(SIDE_W - 8.0, lines as f32 * (CELL + 2.0)), egui::Sense::click());
|
||||
let (area, _) = ui.allocate_exact_size(egui::vec2(SIDE_W - 8.0, lines as f32 * (CELL + 2.0)), egui::Sense::hover());
|
||||
// The colors that can be selected, in table order (for Shift-click ranges).
|
||||
let order: Vec<String> = rows.iter().filter(|(c, mapped)| !c.transparent || *mapped).map(|(c, _)| hex(c.source)).collect();
|
||||
let mut clicked = None;
|
||||
let mut edit = None;
|
||||
let p = ui.painter();
|
||||
for (i, (c, mapped)) in rows.iter().enumerate() {
|
||||
let r = egui::Rect::from_min_size(
|
||||
@@ -1144,6 +1160,15 @@ fn color_table(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) -> Re
|
||||
}
|
||||
} else {
|
||||
p.rect_filled(r, 0.0, fill);
|
||||
if c.shifted {
|
||||
// Shifted by hand: the source color at the upper left, the new one at the lower right.
|
||||
let [red, g, b] = c.source;
|
||||
p.add(egui::Shape::convex_polygon(
|
||||
vec![r.left_top(), r.right_top(), r.left_bottom()],
|
||||
egui::Color32::from_rgb(red, g, b),
|
||||
egui::Stroke::NONE,
|
||||
));
|
||||
}
|
||||
}
|
||||
let mark = if c.color.iter().map(|v| u32::from(*v)).sum::<u32>() > 380 { egui::Color32::BLACK } else { egui::Color32::WHITE };
|
||||
if c.locked {
|
||||
@@ -1161,18 +1186,37 @@ fn color_table(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) -> Re
|
||||
let pickable = !c.transparent || *mapped;
|
||||
let ringed = pickable && picked.iter().any(|h| h.eq_ignore_ascii_case(&hex(c.source)));
|
||||
p.rect_stroke(r, 0.0, egui::Stroke::new(if ringed { 2.0 } else { 1.0 }, if ringed { t.accent } else { t.border }), egui::StrokeKind::Outside);
|
||||
if pickable && resp.clicked() && resp.interact_pointer_pos().is_some_and(|pos| r.contains(pos)) {
|
||||
if !pickable {
|
||||
continue;
|
||||
}
|
||||
let resp = ui.interact(r, swatch_id(&hex(c.source)), egui::Sense::click());
|
||||
if resp.clicked() {
|
||||
clicked = Some(hex(c.source));
|
||||
}
|
||||
// A double-click edits an opaque color: the picker opens on the color as shown, or on the
|
||||
// source color for a color already shifted by hand.
|
||||
if resp.double_clicked() && !c.transparent {
|
||||
edit = Some((hex(c.source), hex(if c.shifted { c.source } else { c.color })));
|
||||
}
|
||||
}
|
||||
if let Some(c) = clicked {
|
||||
let m = ui.input(|i| i.modifiers);
|
||||
pick(d, &order, &c, m.shift, m.command);
|
||||
}
|
||||
if let Some((source, start)) = edit {
|
||||
d.fields.insert("__editColor".into(), json!(source));
|
||||
d.fields.insert("__editStart".into(), json!(start));
|
||||
}
|
||||
let shifted = |c: &str| table.shifted.keys().any(|k| k.eq_ignore_ascii_case(c));
|
||||
// The colors the table shows, by source: Lock, Transparent, Web Shift and Delete Color act only
|
||||
// on these.
|
||||
let palette: Vec<String> =
|
||||
shot.colors.iter().filter(|c| !c.transparent).map(|c| hex(c.source)).chain(shot.mapped.iter().map(|c| hex(*c))).collect();
|
||||
let shown = palette.iter().any(|p| p.eq_ignore_ascii_case(&selected));
|
||||
ui.add_space(4.0);
|
||||
let on = |list: &[String]| list.iter().any(|h| h.eq_ignore_ascii_case(&selected));
|
||||
ui.horizontal(|ui| {
|
||||
ui.add_enabled_ui(!selected.is_empty(), |ui| {
|
||||
ui.add_enabled_ui(shown, |ui| {
|
||||
for (list, on_label, off_label) in [
|
||||
("transparent", tl!("Restore"), tl!("Transparent")),
|
||||
("webShift", tl!("Unshift"), tl!("Web Shift")),
|
||||
@@ -1183,21 +1227,30 @@ fn color_table(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) -> Re
|
||||
"webShift" => &table.web_shift,
|
||||
_ => &table.locked,
|
||||
};
|
||||
let is_on = on(current);
|
||||
if widgets::flat_button(ui, if is_on { on_label } else { off_label }, 88.0).clicked() {
|
||||
// A color shifted by hand stays locked until it is unshifted.
|
||||
let fixed = list == "locked" && shifted(&selected);
|
||||
let is_on = on(current) || fixed;
|
||||
let label = if is_on { on_label } else { off_label };
|
||||
if ui.add_enabled(!fixed, |ui: &mut egui::Ui| widgets::flat_button(ui, label, 88.0)).clicked() {
|
||||
toggle(d, list, &selected, !is_on);
|
||||
// Web Shift replaces a shift by hand.
|
||||
if list == "webShift" && !is_on {
|
||||
unshift(d, &selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// Delete Color (the button and the table's menu) and Restore Generated Table.
|
||||
let (mut delete, mut restore) = (false, false);
|
||||
// Delete Color (the button and the table's menu) and Restore Generated Table. Delete Color
|
||||
// takes only selected colors the table shows (`palette`, by source).
|
||||
let deletable = !selected_in(d, &palette).is_empty();
|
||||
let (mut delete, mut restore, mut unshift_all) = (false, false, false);
|
||||
ui.horizontal(|ui| {
|
||||
delete |= widgets::icon_button_enabled(ui, "trash-2", tl!("Delete Color"), false, !picked.is_empty(), 24.0).clicked();
|
||||
delete |= widgets::icon_button_enabled(ui, "trash-2", tl!("Delete Color"), false, deletable, 24.0).clicked();
|
||||
let menu = widgets::icon_button(ui, "menu", tl!("Color Table"), false, 24.0);
|
||||
let open = menu.clicked();
|
||||
let _ = widgets::popover(&menu, open, |ui| {
|
||||
if widgets::menu_item(ui, tl!("Delete Color"), !picked.is_empty(), false) {
|
||||
if widgets::menu_item(ui, tl!("Delete Color"), deletable, false) {
|
||||
delete = true;
|
||||
ui.close();
|
||||
}
|
||||
@@ -1205,6 +1258,10 @@ fn color_table(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) -> Re
|
||||
restore = true;
|
||||
ui.close();
|
||||
}
|
||||
if widgets::menu_item(ui, tl!("Unshift All Colors"), !table.shifted.is_empty() || !table.web_shift.is_empty(), false) {
|
||||
unshift_all = true;
|
||||
ui.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
let sort = table.sort;
|
||||
@@ -1219,14 +1276,20 @@ fn color_table(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) -> Re
|
||||
if restore {
|
||||
restore_table(d);
|
||||
}
|
||||
if unshift_all {
|
||||
unshift_all_colors(d);
|
||||
}
|
||||
if delete {
|
||||
let palette: Vec<String> =
|
||||
shot.colors.iter().filter(|c| !c.transparent).map(|c| hex(c.source)).chain(shot.mapped.iter().map(|c| hex(*c))).collect();
|
||||
delete_colors(d, &palette)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The selected colors (by source) that `palette`, the colors the table shows, holds.
|
||||
pub(super) fn selected_in(d: &Dialog, palette: &[String]) -> Vec<String> {
|
||||
selection(d).into_iter().filter(|c| palette.iter().any(|p| p.eq_ignore_ascii_case(c))).collect()
|
||||
}
|
||||
|
||||
/// The colour table's selected colors, by source: `__colors`, else `__color`.
|
||||
pub(super) fn selection(d: &Dialog) -> Vec<String> {
|
||||
let many: Vec<String> =
|
||||
@@ -1276,11 +1339,14 @@ pub(super) fn pick(d: &mut Dialog, order: &[String], color: &str, shift: bool, c
|
||||
/// Delete Color: the selected colors join the color table's `deleted` list and leave its other
|
||||
/// lists. The first deletion fixes the palette (`customPalette`) to `palette`, the table's colors
|
||||
/// (by source) with the deleted ones, so the colors left do not change. A deletion that leaves no
|
||||
/// color, or only colors mapped to transparent, is refused with nothing changed. The selection is
|
||||
/// cleared.
|
||||
/// color, or only colors mapped to transparent, is refused with nothing changed. Only selected
|
||||
/// colors that `palette` holds are deleted; when it holds none of them, the table is left as it is
|
||||
/// and the selection is cleared. The selection is cleared after a deletion too.
|
||||
pub(super) fn delete_colors(d: &mut Dialog, palette: &[String]) -> Result<(), String> {
|
||||
let picked = selection(d);
|
||||
let picked = selected_in(d, palette);
|
||||
if picked.is_empty() {
|
||||
d.fields.remove("__colors");
|
||||
d.fields.remove("__color");
|
||||
return Ok(());
|
||||
}
|
||||
let list = |d: &Dialog, key: &str| -> Vec<String> {
|
||||
@@ -1316,6 +1382,9 @@ pub(super) fn delete_colors(d: &mut Dialog, palette: &[String]) -> Result<(), St
|
||||
}
|
||||
}
|
||||
}
|
||||
for c in &picked {
|
||||
unshift(d, c);
|
||||
}
|
||||
set_table(d, "customPalette", json!(custom));
|
||||
set_table(d, "deleted", json!(deleted));
|
||||
d.fields.remove("__colors");
|
||||
@@ -1330,6 +1399,71 @@ pub(super) fn restore_table(d: &mut Dialog) {
|
||||
set_table(d, "customPalette", json!([]));
|
||||
}
|
||||
|
||||
/// The id of the color table's swatch for the source color `source` (`#rrggbb`).
|
||||
pub(super) fn swatch_id(source: &str) -> egui::Id {
|
||||
egui::Id::unique(("sfw-swatch", source.to_ascii_lowercase()))
|
||||
}
|
||||
|
||||
/// The field of the Color Picker's OK over Save for Web: the color the edited swatch shifts to.
|
||||
const SHIFT_TO: &str = "__shiftTo";
|
||||
|
||||
/// The Color Picker over the dialog for the color table's source color `source`, on `start`; its
|
||||
/// OK shifts the color ([`shift_color`]) and its Cancel leaves the table as it was. Nothing opens
|
||||
/// when either is not a color.
|
||||
pub(super) fn edit_color(d: &mut Dialog, source: &str, start: &str) {
|
||||
let (Some(_), Some(c)) = (vectorcraft_color::Color::from_hex(source), vectorcraft_color::Color::from_hex(start)) else { return };
|
||||
d.fields.insert("__shiftSource".into(), json!(source));
|
||||
*d = super::color_picker::over_effect(d, SHIFT_TO, c);
|
||||
}
|
||||
|
||||
/// Back from the Color Picker: its OK's color shifts the color it was opened for.
|
||||
fn take_shift(d: &mut Dialog) {
|
||||
let source = d.fields.remove("__shiftSource");
|
||||
if let (Some(to), Some(source)) = (d.fields.remove(SHIFT_TO), source)
|
||||
&& let (Some(to), Some(source)) = (to.as_str(), source.as_str())
|
||||
{
|
||||
shift_color(d, source, to);
|
||||
}
|
||||
}
|
||||
|
||||
/// Shift the source color `source` to `to` (`colorTable.shifted`), wherever it is in the image; it
|
||||
/// is no longer web-shifted. Picking the source color itself takes the shift away. The color
|
||||
/// becomes the selection. Nothing changes when either is not a color.
|
||||
pub(super) fn shift_color(d: &mut Dialog, source: &str, to: &str) {
|
||||
let hex = |h: &str| vectorcraft_color::Color::from_hex(h).map(|c| c.to_hex());
|
||||
let (Some(source), Some(to)) = (hex(source), hex(to)) else { return };
|
||||
unshift(d, &source);
|
||||
if to != source {
|
||||
let mut map = shifts(d);
|
||||
map.insert(source.clone(), json!(to));
|
||||
set_table(d, "shifted", Value::Object(map));
|
||||
}
|
||||
toggle(d, "webShift", &source, false);
|
||||
d.fields.insert("__colors".into(), json!([source]));
|
||||
d.fields.insert("__color".into(), json!(source));
|
||||
}
|
||||
|
||||
/// The `colorTable.shifted` field.
|
||||
fn shifts(d: &Dialog) -> Map<String, Value> {
|
||||
d.fields.get("colorTable").and_then(|t| t.get("shifted")).and_then(Value::as_object).cloned().unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Take the shift by hand of the source color `source` away.
|
||||
pub(super) fn unshift(d: &mut Dialog, source: &str) {
|
||||
let mut map = shifts(d);
|
||||
let before = map.len();
|
||||
map.retain(|k, _| !k.eq_ignore_ascii_case(source));
|
||||
if map.len() != before {
|
||||
set_table(d, "shifted", Value::Object(map));
|
||||
}
|
||||
}
|
||||
|
||||
/// Unshift All Colors: no color is shifted by hand or web-shifted.
|
||||
pub(super) fn unshift_all_colors(d: &mut Dialog) {
|
||||
set_table(d, "shifted", json!({}));
|
||||
set_table(d, "webShift", json!([]));
|
||||
}
|
||||
|
||||
/// Add `color` to the colour table's `list`, or take it out.
|
||||
pub(super) fn toggle(d: &mut Dialog, list: &str, color: &str, add: bool) {
|
||||
let mut v: Vec<Value> = d.fields.get("colorTable").and_then(|t| t.get(list)).and_then(Value::as_array).cloned().unwrap_or_default();
|
||||
|
||||
@@ -783,6 +783,177 @@ fn colour_table_selection_and_delete_color() {
|
||||
assert_eq!((&d.fields["colorTable"]["deleted"], &d.fields["colorTable"]["customPalette"]), (&json!([]), &json!([])));
|
||||
}
|
||||
|
||||
/// Delete Color takes only selected colors the table shows: a selection the table no longer holds
|
||||
/// (after a change of reduction or color count, or set through `ui.dialog.set`) deletes nothing,
|
||||
/// fixes no palette and is cleared, and a selection partly in the table deletes only what it shows.
|
||||
#[test]
|
||||
fn delete_color_skips_selected_colors_the_table_does_not_show() {
|
||||
let mut d = Dialog::new(save_for_web::KIND, json!({}));
|
||||
let shown: Vec<String> = ["#000000", "#111111"].map(String::from).to_vec();
|
||||
let table = |d: &Dialog, key: &str| d.fields.get("colorTable").and_then(|t| t.get(key)).cloned();
|
||||
d.fields.insert("__colors".into(), json!(["#ABCDEF"]));
|
||||
d.fields.insert("__color".into(), json!("#abcdef"));
|
||||
assert!(save_for_web::selected_in(&d, &shown).is_empty());
|
||||
save_for_web::delete_colors(&mut d, &shown).unwrap();
|
||||
assert_eq!((table(&d, "customPalette"), table(&d, "deleted")), (None, None));
|
||||
assert!(!d.fields.contains_key("__colors") && !d.fields.contains_key("__color"));
|
||||
d.fields.insert("__colors".into(), json!(["#abcdef", "#111111"]));
|
||||
assert_eq!(save_for_web::selected_in(&d, &shown), ["#111111"]);
|
||||
save_for_web::delete_colors(&mut d, &shown).unwrap();
|
||||
assert_eq!((table(&d, "customPalette"), table(&d, "deleted")), (Some(json!(shown)), Some(json!(["#111111"]))));
|
||||
}
|
||||
|
||||
/// A shift by hand replaces a web shift and selects the color; a shift to the color itself takes it
|
||||
/// away; Unshift All Colors clears both kinds; Delete Color takes a deleted color's shift away.
|
||||
#[test]
|
||||
fn colour_table_shift_unshift_and_unshift_all() {
|
||||
let mut d = Dialog::new(save_for_web::KIND, json!({}));
|
||||
save_for_web::toggle(&mut d, "webShift", "#123456", true);
|
||||
save_for_web::shift_color(&mut d, "#123456", "#FF8800");
|
||||
assert_eq!(d.fields["colorTable"], json!({"webShift": [], "shifted": {"#123456": "#ff8800"}}));
|
||||
assert_eq!(save_for_web::selection(&d), ["#123456"]);
|
||||
// Not a color: nothing changes.
|
||||
let before = d.fields.clone();
|
||||
save_for_web::shift_color(&mut d, "nope", "#000000");
|
||||
save_for_web::shift_color(&mut d, "#123456", "nope");
|
||||
assert_eq!(d.fields, before);
|
||||
save_for_web::shift_color(&mut d, "#ABCDEF", "#00ff00");
|
||||
save_for_web::shift_color(&mut d, "#123456", "#123456");
|
||||
assert_eq!(d.fields["colorTable"]["shifted"], json!({"#abcdef": "#00ff00"}));
|
||||
save_for_web::toggle(&mut d, "webShift", "#222222", true);
|
||||
save_for_web::unshift_all_colors(&mut d);
|
||||
assert_eq!((&d.fields["colorTable"]["shifted"], &d.fields["colorTable"]["webShift"]), (&json!({}), &json!([])));
|
||||
let order: Vec<String> = ["#000000", "#222222"].map(String::from).to_vec();
|
||||
save_for_web::shift_color(&mut d, "#222222", "#ffffff");
|
||||
save_for_web::delete_colors(&mut d, &order).unwrap();
|
||||
assert_eq!((&d.fields["colorTable"]["shifted"], &d.fields["colorTable"]["deleted"]), (&json!({}), &json!(["#222222"])));
|
||||
}
|
||||
|
||||
/// One frame of `app` in `ctx`, 50 ms after the last.
|
||||
fn tick(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<egui::Event>) {
|
||||
let time = ctx.input(|i| i.time) + 0.05;
|
||||
let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 1000.0)));
|
||||
let mut out = ctx.run_ui(egui::RawInput { screen_rect, events, time: Some(time), ..Default::default() }, |ui| show(app, ui.ctx()));
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
|
||||
/// Double-click the color table's swatch of the source color `source`.
|
||||
fn double_click_swatch(app: &mut VectorcraftApp, ctx: &egui::Context, source: &str) {
|
||||
for _ in 0..3 {
|
||||
tick(app, ctx, vec![]);
|
||||
}
|
||||
let pos = ctx.read_response(save_for_web::swatch_id(source)).unwrap_or_else(|| panic!("no swatch for {source}")).rect.center();
|
||||
let button = |pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
|
||||
tick(app, ctx, vec![egui::Event::PointerMoved(pos), button(true)]);
|
||||
tick(app, ctx, vec![button(false)]);
|
||||
tick(app, ctx, vec![button(true)]);
|
||||
tick(app, ctx, vec![button(false)]);
|
||||
tick(app, ctx, vec![]);
|
||||
}
|
||||
|
||||
/// The color the open Color Picker shows.
|
||||
fn picker_color(app: &VectorcraftApp) -> Option<String> {
|
||||
let d = app.ui.dialog.as_ref()?;
|
||||
assert_eq!(d.kind, "colorPicker", "the Color Picker is open");
|
||||
d.fields.get("color").and_then(vectorcraft_engine::cmd::color_value).map(|c| c.to_hex())
|
||||
}
|
||||
|
||||
/// A double-click on a swatch opens the Color Picker on its color. Cancel changes nothing; OK
|
||||
/// shifts the color in the table and the saved file. A double-click on a shifted swatch opens the
|
||||
/// picker on the source color, and Web Shift replaces the shift by hand.
|
||||
#[test]
|
||||
fn double_clicking_a_swatch_shifts_its_color() {
|
||||
let dir = vectorcraft_testkit::temp_dir("sfw-shift-color");
|
||||
let (mut app, _) = app(&dir, false);
|
||||
app.run("shape.rectangle", json!({"x": 40, "y": 0, "width": 20, "height": 40})).unwrap();
|
||||
app.run("paint.setFill", json!({"color": "#0000ff"})).unwrap();
|
||||
app.run("file.saveForWeb", json!({})).unwrap();
|
||||
for (k, v) in [("format", json!("gif")), ("antiAlias", json!("none")), ("dither", json!("none"))] {
|
||||
set(&mut app, k, v);
|
||||
}
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let shifted = |app: &VectorcraftApp| app.ui.dialog.as_ref().map(|d| d.fields["colorTable"]["shifted"].clone());
|
||||
double_click_swatch(&mut app, &ctx, "#0000ff");
|
||||
assert_eq!(picker_color(&app).as_deref(), Some("#0000ff"));
|
||||
crate::dialogs::cancel(&mut app);
|
||||
tick(&mut app, &ctx, vec![]);
|
||||
assert_eq!((kind(&app), shifted(&app)), (Some(save_for_web::KIND), Some(json!({}))), "Cancel shifts nothing");
|
||||
double_click_swatch(&mut app, &ctx, "#0000ff");
|
||||
set(&mut app, "color", json!("#00ff00"));
|
||||
confirm(&mut app).unwrap();
|
||||
tick(&mut app, &ctx, vec![]);
|
||||
assert_eq!((kind(&app), shifted(&app)), (Some(save_for_web::KIND), Some(json!({"#0000ff": "#00ff00"}))), "OK shifts the color");
|
||||
// The shifted swatch opens on its source color.
|
||||
double_click_swatch(&mut app, &ctx, "#0000ff");
|
||||
assert_eq!(picker_color(&app).as_deref(), Some("#0000ff"));
|
||||
crate::dialogs::cancel(&mut app);
|
||||
// Web Shift replaces the shift by hand.
|
||||
click_text(&mut app, "Web Shift");
|
||||
let t = app.ui.dialog.as_ref().unwrap().fields["colorTable"].clone();
|
||||
assert_eq!((&t["shifted"], &t["webShift"]), (&json!({}), &json!(["#0000ff"])));
|
||||
// Shifted again, the color reaches the saved file and is remembered.
|
||||
double_click_swatch(&mut app, &ctx, "#0000ff");
|
||||
set(&mut app, "color", json!("#00ff00"));
|
||||
confirm(&mut app).unwrap();
|
||||
tick(&mut app, &ctx, vec![]);
|
||||
let r = confirm(&mut app).unwrap();
|
||||
let image = image::open(r["path"].as_str().unwrap()).unwrap().to_rgba8();
|
||||
assert_eq!((image.get_pixel(50, 20).0, image.get_pixel(20, 14).0), ([0, 255, 0, 255], [204, 51, 0, 255]));
|
||||
let remembered = app.session.last_web_settings().color_table;
|
||||
assert_eq!((remembered.shifted.get("#0000ff").map(String::as_str), remembered.web_shift.len()), (Some("#00ff00"), 0));
|
||||
}
|
||||
|
||||
/// `ui.dialog.set` accepts `__editColor`, and the next frame opens the Color Picker on that color,
|
||||
/// whose OK shifts it.
|
||||
#[test]
|
||||
fn dialog_set_edit_color_opens_the_color_picker() {
|
||||
let dir = vectorcraft_testkit::temp_dir("sfw-edit-color-set");
|
||||
let (mut app, _) = app(&dir, false);
|
||||
app.run("shape.rectangle", json!({"x": 40, "y": 0, "width": 20, "height": 40})).unwrap();
|
||||
app.run("paint.setFill", json!({"color": "#0000ff"})).unwrap();
|
||||
app.run("file.saveForWeb", json!({})).unwrap();
|
||||
set(&mut app, "format", json!("gif"));
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let (req, _) = crate::control::ControlRequest::new("ui.dialog.set", json!({"field": "__editColor", "value": "#0000ff"}));
|
||||
let crate::control::Outcome::Done(r) = crate::control::handle(&mut app, &ctx, &req) else { panic!("not done") };
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
tick(&mut app, &ctx, vec![]);
|
||||
assert_eq!(picker_color(&app).as_deref(), Some("#0000ff"));
|
||||
set(&mut app, "color", json!("#00ff00"));
|
||||
confirm(&mut app).unwrap();
|
||||
tick(&mut app, &ctx, vec![]);
|
||||
let shifted = app.ui.dialog.as_ref().map(|d| d.fields["colorTable"]["shifted"].clone());
|
||||
assert_eq!((kind(&app), shifted), (Some(save_for_web::KIND), Some(json!({"#0000ff": "#00ff00"}))));
|
||||
}
|
||||
|
||||
/// Lock, Transparent and Web Shift are off while the selected color (`__color`) is one the table
|
||||
/// no longer shows, so a click adds it to no list; with a color the table shows, Lock locks it.
|
||||
#[test]
|
||||
fn table_buttons_skip_a_selected_color_the_table_does_not_show() {
|
||||
let dir = vectorcraft_testkit::temp_dir("sfw-stale-anchor");
|
||||
let (mut app, _) = app(&dir, false);
|
||||
app.run("shape.rectangle", json!({"x": 40, "y": 0, "width": 20, "height": 40})).unwrap();
|
||||
app.run("paint.setFill", json!({"color": "#0000ff"})).unwrap();
|
||||
app.run("file.saveForWeb", json!({})).unwrap();
|
||||
for (k, v) in [("format", json!("gif")), ("antiAlias", json!("none")), ("dither", json!("none"))] {
|
||||
set(&mut app, k, v);
|
||||
}
|
||||
let table = |app: &VectorcraftApp| app.ui.dialog.as_ref().and_then(|d| d.fields.get("colorTable").cloned()).unwrap_or_default();
|
||||
let has = |app: &VectorcraftApp, list: &str, c: &str| table(app)[list].as_array().is_some_and(|l| l.iter().any(|v| v == c));
|
||||
set(&mut app, "__color", json!("#abcdef"));
|
||||
for label in ["Lock", "Transparent", "Web Shift"] {
|
||||
click_text(&mut app, label);
|
||||
}
|
||||
for list in ["locked", "transparent", "webShift"] {
|
||||
assert!(!has(&app, list, "#abcdef"), "{list}: {}", table(&app));
|
||||
}
|
||||
set(&mut app, "__color", json!("#0000ff"));
|
||||
click_text(&mut app, "Lock");
|
||||
assert!(has(&app, "locked", "#0000ff"), "{}", table(&app));
|
||||
}
|
||||
|
||||
/// Click the dialog's text `label` with the pointer (frames a quarter second apart).
|
||||
fn click_text(app: &mut VectorcraftApp, label: &str) {
|
||||
let ctx = egui::Context::default();
|
||||
|
||||
@@ -793,6 +793,7 @@ font-technology Variable Променливи
|
||||
Delete Brush Изтриване на четка
|
||||
Delete Color Изтриване на цвят
|
||||
Restore Generated Table Възстановяване на генерираната таблица
|
||||
Unshift All Colors Преместване назад на всички цветове
|
||||
Delete Character Style Изтриване на стил за знаци
|
||||
Delete Empty Artboards Изтриване на празни работни области
|
||||
Delete Freeform Point Изтриване на свободна точка
|
||||
@@ -3142,6 +3143,8 @@ digits Malayalam Малаялам
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Колко близо на екрана показалецът или влачена точка трябва да стигне до обект, за да прилепнат интелигентните водачи; разстоянието е еднакво при всеки мащаб.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Прилепва края на линеен сегмент или окръжност, начертана от центъра си, така че да докосва близка крива.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Прилепва края на линеен сегмент така, че да среща близък прав сегмент под прав ъгъл.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показва номера на всяка отрязана част в каре в горния ѝ ляв ъгъл върху платното; когато е изключено, контурите на отрязаните части остават видими.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Цветът на контурите на потребителските и обектните отрязани части и на каретата с номерата им; автоматичните отрязани части използват по-блед нюанс на този цвят.
|
||||
Reset all preferences to their defaults? Да се нулират ли всички настройки до стойностите по подразбиране?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Стойностите по подразбиране се прилагат, когато щракнете върху ОК в Настройки. Отказ там запазва текущите ви настройки.
|
||||
Restore Recovered Documents Възстановяване на възстановените документи
|
||||
@@ -3362,6 +3365,9 @@ digits Malayalam Малаялам
|
||||
No menu item Няма елемент в менюто
|
||||
Toolbar Лента с инструменти
|
||||
{toolbar}, in the {tool} group {toolbar}, в групата на {tool}
|
||||
In the menu bar: {path} В лентата с менюта: {path}
|
||||
In the {group} group: press and hold to open it В групата {group}: натиснете и задръжте, за да я отворите
|
||||
{home}, not shown now {home}, не се показва сега
|
||||
@plural {n} result|{n} results {n} резултат|{n} резултата
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} от {n} резултат. Продължете да пишете, за да ги стесните.|{shown} от {n} резултата. Продължете да пишете, за да ги стесните.
|
||||
Recent Commands Последни команди
|
||||
@@ -4681,6 +4687,7 @@ axis Both И двете
|
||||
@msg choose a location for the package изберете местоположение за пакета
|
||||
@msg clipboard is empty клипбордът е празен
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: поне един цвят трябва да остане в цветовата таблица
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` назовава цвят, който друг ключ също назовава
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` не е цвят като "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: най-много {MAX_TABLE} цвята
|
||||
@msg command `{0}` is not available right now: {1} команда `{0}` не е налична в момента: {1}
|
||||
@@ -7028,6 +7035,7 @@ breakText Glyphs Глифи
|
||||
@msg One path lies inside the other, so they have no common tangents Единият път е вътре в другия, затова нямат общи допирателни
|
||||
@msg The paths overlap, so they have no internal tangents Пътищата се припокриват, затова нямат вътрешни допирателни
|
||||
@msg One path lies inside the other, so they have no internal tangents Единият път е вътре в другия, затова нямат вътрешни допирателни
|
||||
@msg The point lies inside the path, so it has no tangents Точката е вътре в пътя, затова няма допирателни
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Разширяване на тиретата в пътища
|
||||
@msg select paths with dashed strokes to expand изберете пътища с прекъснат щрих за разширяване
|
||||
@@ -7370,3 +7378,8 @@ breakText Glyphs Глифи
|
||||
@msg A joint does not close by {gap} pt. Една връзка не се затваря с {gap} pt.
|
||||
@msg Two panels pass through each other. Два панела минават един през друг.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
Pressure Sensitive Чувствителни на натиск
|
||||
Flex Ribbon Гъвкава лента
|
||||
Pulse Stroke Пулсиращ щрих
|
||||
Round Flow Кръгъл поток
|
||||
Chisel Flow Скосен поток
|
||||
|
Can't render this file because it is too large.
|
@@ -3488,6 +3488,7 @@ theme Appearance Izgled
|
||||
Delete Brush Izbriši četkicu
|
||||
Delete Color Izbriši boju
|
||||
Restore Generated Table Vrati generisanu tabelu
|
||||
Unshift All Colors Poništi pomak svih boja
|
||||
Delete Symbol Izbriši simbol
|
||||
Delete the selected symbol? Izbrisati odabrani simbol?
|
||||
Delete the selected symbols? Izbrisati odabrane simbole?
|
||||
@@ -4483,6 +4484,9 @@ font-technology Variable Varijabilni
|
||||
No menu item Nema stavke menija
|
||||
Toolbar Traka s alatima
|
||||
{toolbar}, in the {tool} group {toolbar}, u grupi {tool}
|
||||
In the menu bar: {path} Na traci menija: {path}
|
||||
In the {group} group: press and hold to open it U grupi {group}: pritisnite i držite da je otvorite
|
||||
{home}, not shown now {home}, trenutno nije prikazano
|
||||
@plural {n} result|{n} results {n} rezultat|{n} rezultata|{n} rezultata
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} od {n} rezultata. Nastavite kucati da ih suzite.|{shown} od {n} rezultata. Nastavite kucati da ih suzite.|{shown} od {n} rezultata. Nastavite kucati da ih suzite.
|
||||
Recent Commands Nedavne naredbe
|
||||
@@ -4600,6 +4604,8 @@ font-technology Variable Varijabilni
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Koliko blizu na ekranu pokazivač ili prevučena tačka mora doći do objekta da bi ga pametne vodilice uhvatile; udaljenost je ista pri svakom zumu.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Hvata kraj segmenta linije ili krug nacrtan iz središta tako da dodiruje obližnju krivu.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Hvata kraj segmenta linije tako da pod pravim uglom susreće obližnji ravni segment.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Prikazuje broj svakog isječka u okviru u njegovom gornjem lijevom uglu na platnu; kada je isključeno, obrisi isječaka i dalje se prikazuju.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Boja obrisa korisničkih i objektnih isječaka i okvira s njihovim brojevima; automatski isječci koriste blijeđu nijansu te boje.
|
||||
Reset all preferences to their defaults? Vratiti sve postavke na zadane vrijednosti?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Zadane vrijednosti primjenjuju se kada kliknete U redu u Postavkama. Otkaži tamo zadržava vaše trenutne postavke.
|
||||
Smaller ↔ Larger Manje ↔ veće
|
||||
@@ -5089,6 +5095,7 @@ imageTrace Outline Obris
|
||||
@msg choose a location for the package odaberite lokaciju za paket
|
||||
@msg clipboard is empty međuspremnik je prazan
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: barem jedna boja mora ostati u tabeli boja
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` imenuje boju koju imenuje i drugi ključ
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` nije boja poput "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: najviše {MAX_TABLE} boja
|
||||
@msg command `{0}` is not available right now: {1} naredba `{0}` trenutno nije dostupna: {1}
|
||||
@@ -7077,6 +7084,7 @@ shape Open Otvoren
|
||||
@msg One path lies inside the other, so they have no common tangents Jedna putanja leži unutar druge, pa nemaju zajedničkih tangenti
|
||||
@msg The paths overlap, so they have no internal tangents Putanje se preklapaju, pa nemaju unutrašnjih tangenti
|
||||
@msg One path lies inside the other, so they have no internal tangents Jedna putanja leži unutar druge, pa nemaju unutrašnjih tangenti
|
||||
@msg The point lies inside the path, so it has no tangents Tačka leži unutar putanje, pa nema tangenti
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Proširi crtice u putanje
|
||||
@msg select paths with dashed strokes to expand odaberite putanje s isprekidanim potezom za proširivanje
|
||||
@@ -7425,3 +7433,8 @@ shape Open Otvoren
|
||||
@msg A joint does not close by {gap} pt. Spoj se ne zatvara za {gap} pt.
|
||||
@msg Two panels pass through each other. Dva panela prolaze jedan kroz drugi.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine"
|
||||
Pressure Sensitive Osjetljivo na pritisak
|
||||
Flex Ribbon Savijajuća traka
|
||||
Pulse Stroke Pulsirajući potez
|
||||
Round Flow Okrugli tok
|
||||
Chisel Flow Kosi tok
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -1156,6 +1156,7 @@ antiAlias Sharp Nítid
|
||||
Delete Brush Suprimeix el pinzell
|
||||
Delete Color Suprimeix el color
|
||||
Restore Generated Table Restaura la taula generada
|
||||
Unshift All Colors Desfés el desplaçament de tots els colors
|
||||
Delete Character Style Suprimeix l’estil de caràcter
|
||||
Delete Data Set Suprimeix el conjunt de dades
|
||||
Delete Data Sets Suprimeix els conjunts de dades
|
||||
@@ -3984,6 +3985,8 @@ digits Malayalam Malaiàlam
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Com d’a prop a la pantalla han d’arribar el punter o un punt arrossegat a l’art perquè les guies intel·ligents s’hi ajustin; la distància és la mateixa a qualsevol zoom.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Ajusta l’extrem d’un segment de línia, o un cercle dibuixat des del centre, perquè toqui una corba propera.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta l’extrem d’un segment de línia perquè trobi un segment recte proper en angle recte.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Mostra al llenç el número de cada tall en un requadre a la seva cantonada superior esquerra; si està desactivat, els contorns dels talls continuen visibles.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. El color dels contorns dels talls d’usuari i d’objecte i dels requadres amb el seu número; els talls automàtics fan servir un to més apagat d’aquest color.
|
||||
Reset all preferences to their defaults? Voleu restablir totes les preferències als valors predeterminats?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Els valors predeterminats s’apliquen quan feu clic a D’acord a Preferències. Cancel·la allà conserva les preferències actuals.
|
||||
Restore Recovered Documents Restaura els documents recuperats
|
||||
@@ -4305,6 +4308,9 @@ digits Malayalam Malaiàlam
|
||||
No menu item Cap element de menú
|
||||
Toolbar Barra d’eines
|
||||
{toolbar}, in the {tool} group {toolbar}, al grup {tool}
|
||||
In the menu bar: {path} A la barra de menús: {path}
|
||||
In the {group} group: press and hold to open it Al grup {group}: manteniu premut per obrir-lo
|
||||
{home}, not shown now {home}, ara no es mostra
|
||||
@plural {n} result|{n} results {n} resultat|{n} resultats
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultat. Continueu escrivint per reduir-los.|{shown} de {n} resultats. Continueu escrivint per reduir-los.
|
||||
Recent Commands Ordres recents
|
||||
@@ -5863,6 +5869,7 @@ digits Malayalam Malaiàlam
|
||||
@msg clipboard is empty el porta-retalls és buit
|
||||
@msg closing needs three anchors el tancament necessita tres punts d’ancoratge
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: almenys un color ha de quedar a la taula de colors
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` indica un color que també indica una altra clau
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` no és un color com "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: com a màxim {MAX_TABLE} colors
|
||||
@msg column docks a set as a dock column, with no anchor or icon column acobla un conjunt com a columna d’acoblament, sense àncora ni icona
|
||||
@@ -7817,6 +7824,7 @@ breakText Glyphs Glifs
|
||||
@msg One path lies inside the other, so they have no common tangents Un camí és dins de l’altre, per tant no tenen tangents comunes
|
||||
@msg The paths overlap, so they have no internal tangents Els camins se superposen, per tant no tenen tangents internes
|
||||
@msg One path lies inside the other, so they have no internal tangents Un camí és dins de l’altre, per tant no tenen tangents internes
|
||||
@msg The point lies inside the path, so it has no tangents El punt és dins del camí, per tant no té tangents
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Expandeix els guions en camins
|
||||
@msg select paths with dashed strokes to expand seleccioneu camins amb traç discontinu per expandir
|
||||
@@ -8323,4 +8331,9 @@ breakText Glyphs Glifs
|
||||
@msg A joint does not close by {gap} pt. Una unió no es tanca per {gap} pt.
|
||||
@msg Two panels pass through each other. Dos panells es travessen l’un a l’altre.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
Pressure Sensitive Sensible a la pressió
|
||||
Flex Ribbon Cinta flexible
|
||||
Pulse Stroke Traç pulsant
|
||||
Round Flow Flux rodó
|
||||
Chisel Flow Flux bisellat
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: utilitzeu "{_1}" o "{_2}"
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -3588,6 +3588,7 @@ theme Appearance Motiv
|
||||
Delete Brush Odstranit štětec
|
||||
Delete Color Odstranit barvu
|
||||
Restore Generated Table Obnovit vygenerovanou tabulku
|
||||
Unshift All Colors Zrušit posun všech barev
|
||||
Delete Symbol Odstranit symbol
|
||||
Delete the selected symbol? Odstranit vybraný symbol?
|
||||
Delete the selected symbols? Odstranit vybrané symboly?
|
||||
@@ -4591,6 +4592,9 @@ font-technology Variable Variabilní
|
||||
No menu item Žádná položka nabídky
|
||||
Toolbar Panel nástrojů
|
||||
{toolbar}, in the {tool} group {toolbar}, ve skupině {tool}
|
||||
In the menu bar: {path} V řádku nabídek: {path}
|
||||
In the {group} group: press and hold to open it Ve skupině {group}: stisknutím a podržením ji otevřete
|
||||
{home}, not shown now {home}, nyní není zobrazeno
|
||||
@plural {n} result|{n} results {n} výsledek|{n} výsledky|{n} výsledků
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} z {n} výsledku. Pište dál a výsledky se zúží.|{shown} z {n} výsledků. Pište dál a výsledky se zúží.|{shown} z {n} výsledků. Pište dál a výsledky se zúží.
|
||||
Recent Commands Nedávné příkazy
|
||||
@@ -4708,6 +4712,8 @@ font-technology Variable Variabilní
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Jak blízko na obrazovce musí ukazatel nebo tažený bod přijít ke kresbě, aby se chytrá vodítka přichytila; vzdálenost je stejná při každém zvětšení.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Přichytí konec úsečky nebo kružnici kreslenou od středu tak, aby se dotýkala blízké křivky.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Přichytí konec úsečky tak, aby se s blízkým rovným segmentem setkal v pravém úhlu.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Zobrazí na plátně číslo každého řezu v rámečku v jeho levém horním rohu; když je vypnuto, obrysy řezů zůstanou zobrazené.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Barva obrysů uživatelských a objektových řezů a rámečků s jejich čísly; automatické řezy používají tlumenější odstín této barvy.
|
||||
Reset all preferences to their defaults? Obnovit všechny předvolby na výchozí hodnoty?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Výchozí hodnoty se použijí po klepnutí na OK v Předvolbách. Zrušit tam zachová vaše současné předvolby.
|
||||
Smaller ↔ Larger Menší ↔ Větší
|
||||
@@ -5384,6 +5390,7 @@ liquify-list-end {0}, {1} {0} a {1}
|
||||
@msg choose a location for the package zvolte umístění balíčku
|
||||
@msg clipboard is empty schránka je prázdná
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: v tabulce barev musí zůstat alespoň jedna barva
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` označuje barvu, kterou označuje i jiný klíč
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` není barva jako "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: nejvýše {MAX_TABLE} barev
|
||||
@msg command `{0}` is not available right now: {1} příkaz `{0}` nyní není k dispozici: {1}
|
||||
@@ -7802,6 +7809,7 @@ breakText Glyphs Glyfy
|
||||
@msg One path lies inside the other, so they have no common tangents Jedna cesta leží uvnitř druhé, takže nemají žádné společné tečny
|
||||
@msg The paths overlap, so they have no internal tangents Cesty se překrývají, takže nemají žádné vnitřní tečny
|
||||
@msg One path lies inside the other, so they have no internal tangents Jedna cesta leží uvnitř druhé, takže nemají žádné vnitřní tečny
|
||||
@msg The point lies inside the path, so it has no tangents Bod leží uvnitř cesty, takže nemá žádné tečny
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Rozložit čárky na cesty
|
||||
@msg select paths with dashed strokes to expand vyberte cesty s čárkovaným tahem k rozložení
|
||||
@@ -10108,6 +10116,11 @@ breakText Glyphs Glyfy
|
||||
@msg A panel is not joined to the rest by a crease. Panel není se zbytkem spojen žádnou linií bigu.
|
||||
@msg A fold line is on a non-printing layer. Linie skladu je na netisknutelné vrstvě.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panely: {panels}, panty: {hinges}, chyby: {errors}, upozornění: {warnings}
|
||||
Pressure Sensitive Citlivé na tlak
|
||||
Flex Ribbon Pružná stuha
|
||||
Pulse Stroke Pulzující tah
|
||||
Round Flow Kulatý tah
|
||||
Chisel Flow Zkosený tah
|
||||
Fold Preview Náhled skládání
|
||||
Fold Složení
|
||||
Show Fold Lines Zobrazit linie skladu
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6044,6 +6044,7 @@ theme Appearance Udseende
|
||||
Delete Brush Slet pensel
|
||||
Delete Color Slet farve
|
||||
Restore Generated Table Gendan genereret tabel
|
||||
Unshift All Colors Fjern skift af alle farver
|
||||
Delete Symbol Slet symbol
|
||||
Delete the selected symbol? Vil du slette det markerede symbol?
|
||||
Delete the selected symbols? Vil du slette de markerede symboler?
|
||||
@@ -7015,6 +7016,9 @@ font-technology Variable Variable
|
||||
No menu item Intet menupunkt
|
||||
Toolbar Værktøjslinje
|
||||
{toolbar}, in the {tool} group {toolbar}, i gruppen {tool}
|
||||
In the menu bar: {path} I menulinjen: {path}
|
||||
In the {group} group: press and hold to open it I gruppen {group}: tryk og hold for at åbne den
|
||||
{home}, not shown now {home}, vises ikke nu
|
||||
@plural {n} result|{n} results {n} resultat|{n} resultater
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} af {n} resultat. Skriv videre for at indsnævre dem.|{shown} af {n} resultater. Skriv videre for at indsnævre dem.
|
||||
Recent Commands Seneste kommandoer
|
||||
@@ -7132,6 +7136,8 @@ font-technology Variable Variable
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Hvor tæt på skærmen markøren eller et trukket punkt skal komme på grafik, for at de smarte hjælpelinjer fastgør til den; afstanden er den samme ved alle zoomniveauer.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Fastgør enden af et linjesegment eller en cirkel tegnet fra midten, så den rører en nærliggende kurve.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Fastgør enden af et linjesegment, så det møder et nærliggende lige segment i en ret vinkel.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Viser hvert udsnits nummer i en boks i dets øverste venstre hjørne på lærredet; når den er slået fra, vises udsnittenes konturer stadig.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Farven på konturerne af bruger- og objektudsnit og på boksene med deres numre; automatiske udsnit bruger en svagere nuance af den.
|
||||
Reset all preferences to their defaults? Nulstil alle præferencer til standard?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Standardværdierne anvendes, når du klikker på OK i Præferencer. Annullér der beholder dine nuværende præferencer.
|
||||
Smaller ↔ Larger Mindre ↔ Større
|
||||
@@ -7578,6 +7584,7 @@ imageTrace Outline Kontur
|
||||
@msg choose a location for the package vælg en placering til pakken
|
||||
@msg clipboard is empty udklipsholderen er tom
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: mindst én farve skal blive i farvetabellen
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` angiver en farve, som en anden nøgle også angiver
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` er ikke en farve som "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: højst {MAX_TABLE} farver
|
||||
@msg command `{0}` is not available right now: {1} kommandoen `{0}` er ikke tilgængelig lige nu: {1}
|
||||
@@ -9856,6 +9863,7 @@ breakText Glyphs Glyffer
|
||||
@msg One path lies inside the other, so they have no common tangents Den ene sti ligger inden i den anden, så de har ingen fælles tangenter
|
||||
@msg The paths overlap, so they have no internal tangents Stierne overlapper, så de har ingen indre tangenter
|
||||
@msg One path lies inside the other, so they have no internal tangents Den ene sti ligger inden i den anden, så de har ingen indre tangenter
|
||||
@msg The point lies inside the path, so it has no tangents Punktet ligger inden i stien, så det har ingen tangenter
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Udvid streger til stier
|
||||
@msg select paths with dashed strokes to expand vælg stier med stiplet streg, der skal udvides
|
||||
@@ -10211,3 +10219,8 @@ breakText Glyphs Glyffer
|
||||
@msg A joint does not close by {gap} pt. En samling lukker ikke med {gap} pt.
|
||||
@msg Two panels pass through each other. To paneler går gennem hinanden.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine"
|
||||
Pressure Sensitive Trykfølsom
|
||||
Flex Ribbon Fleksibelt bånd
|
||||
Pulse Stroke Pulserende strøg
|
||||
Round Flow Rundt strøg
|
||||
Chisel Flow Skråt strøg
|
||||
|
Can't render this file because it is too large.
|
@@ -800,6 +800,7 @@ font-technology Variable Variabel
|
||||
Delete Brush Pinsel löschen
|
||||
Delete Color Farbe löschen
|
||||
Restore Generated Table Generierte Tabelle wiederherstellen
|
||||
Unshift All Colors Verschiebung aller Farben aufheben
|
||||
Delete Character Style Zeichenformat löschen
|
||||
Delete Empty Artboards Leere Zeichenflächen löschen
|
||||
Delete Freeform Point Freiformpunkt löschen
|
||||
@@ -3206,6 +3207,8 @@ digits Malayalam Malayalam
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Wie nah der Zeiger oder ein gezogener Punkt auf dem Bildschirm an Bildmaterial kommen muss, damit intelligente Hilfslinien einrasten; der Abstand ist bei jedem Zoom gleich.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Richtet das Ende eines Liniensegments oder einen von der Mitte aus gezeichneten Kreis so aus, dass er eine nahe Kurve berührt.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Richtet das Ende eines Liniensegments so aus, dass es ein nahes gerades Segment im rechten Winkel trifft.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Zeigt auf der Arbeitsfläche die Nummer jedes Slices in einem Kästchen oben links im Slice; ist die Option aus, werden die Slice-Umrisse weiterhin angezeigt.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Die Farbe der Umrisse von Benutzer- und Objekt-Slices und ihrer Nummernkästchen; automatische Slices verwenden einen blasseren Ton davon.
|
||||
Reset all preferences to their defaults? Alle Voreinstellungen auf ihre Standardwerte zurücksetzen?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Die Standardwerte werden angewendet, wenn Sie in den Voreinstellungen auf OK klicken. Abbrechen dort behält Ihre aktuellen Voreinstellungen.
|
||||
Restore Recovered Documents Wiederhergestellte Dokumente öffnen
|
||||
@@ -3440,6 +3443,9 @@ digits Malayalam Malayalam
|
||||
No menu item Kein Menüeintrag
|
||||
Toolbar Werkzeugleiste
|
||||
{toolbar}, in the {tool} group {toolbar}, in der Gruppe „{tool}“
|
||||
In the menu bar: {path} In der Menüleiste: {path}
|
||||
In the {group} group: press and hold to open it In der Gruppe {group}: zum Öffnen gedrückt halten
|
||||
{home}, not shown now {home}, derzeit nicht angezeigt
|
||||
Tool Werkzeug
|
||||
Command Befehl
|
||||
@plural {n} result|{n} results {n} Ergebnis|{n} Ergebnisse
|
||||
@@ -4979,6 +4985,7 @@ liquify-list-end {0}, {1} {0} und {1}
|
||||
@msg choose a location for the package wählen Sie einen Speicherort für das Paket
|
||||
@msg clipboard is empty die Zwischenablage ist leer
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: Mindestens eine Farbe muss in der Farbtabelle bleiben
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` bezeichnet eine Farbe, die auch ein anderer Schlüssel bezeichnet
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` ist keine Farbe wie "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: höchstens {MAX_TABLE} Farben
|
||||
@msg command `{0}` is not available right now: {1} der Befehl `{0}` ist derzeit nicht verfügbar: {1}
|
||||
@@ -7390,6 +7397,7 @@ breakText Glyphs Glyphen
|
||||
@msg One path lies inside the other, so they have no common tangents Ein Pfad liegt im anderen, daher haben sie keine gemeinsamen Tangenten
|
||||
@msg The paths overlap, so they have no internal tangents Die Pfade überlappen sich, daher haben sie keine inneren Tangenten
|
||||
@msg One path lies inside the other, so they have no internal tangents Ein Pfad liegt im anderen, daher haben sie keine inneren Tangenten
|
||||
@msg The point lies inside the path, so it has no tangents Der Punkt liegt im Pfad, daher hat er keine Tangenten
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Striche in Pfade umwandeln
|
||||
@msg select paths with dashed strokes to expand wählen Sie Pfade mit gestrichelter Kontur zum Umwandeln aus
|
||||
@@ -9712,6 +9720,11 @@ breakText Glyphs Glyphen
|
||||
@msg A panel is not joined to the rest by a crease. Ein Feld ist durch keine Rilllinie mit den übrigen verbunden.
|
||||
@msg A fold line is on a non-printing layer. Eine Faltlinie liegt auf einer nicht druckbaren Ebene.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Felder: {panels}, Scharniere: {hinges}, Fehler: {errors}, Warnungen: {warnings}
|
||||
Pressure Sensitive Druckempfindlich
|
||||
Flex Ribbon Flexibles Band
|
||||
Pulse Stroke Pulsierender Strich
|
||||
Round Flow Runder Fluss
|
||||
Chisel Flow Schräger Fluss
|
||||
Fold Preview Faltvorschau
|
||||
Fold Falten
|
||||
Show Fold Lines Faltlinien einblenden
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -778,6 +778,7 @@ font-technology Variable Μεταβλητές
|
||||
Delete Brush Διαγραφή πινέλου
|
||||
Delete Color Διαγραφή χρώματος
|
||||
Restore Generated Table Επαναφορά του παραγόμενου πίνακα
|
||||
Unshift All Colors Αναίρεση μετατόπισης όλων των χρωμάτων
|
||||
Delete Character Style Διαγραφή στυλ χαρακτήρων
|
||||
Delete Empty Artboards Διαγραφή κενών πινάκων σχεδίασης
|
||||
Delete Freeform Point Διαγραφή ελεύθερου σημείου
|
||||
@@ -4061,6 +4062,8 @@ digits Malayalam Μαλαγιάλαμ
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Πόσο κοντά στην οθόνη πρέπει να φτάσει ο δείκτης ή ένα σημείο που σύρεται σε γραφικά για να προσκολληθούν οι έξυπνοι οδηγοί· η απόσταση είναι ίδια σε κάθε ζουμ.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Προσκολλά το άκρο ενός ευθύγραμμου τμήματος ή έναν κύκλο που σχεδιάζεται από το κέντρο του ώστε να αγγίζει μια κοντινή καμπύλη.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Προσκολλά το άκρο ενός ευθύγραμμου τμήματος ώστε να συναντά ένα κοντινό ευθύ τμήμα σε ορθή γωνία.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Εμφανίζει στον καμβά τον αριθμό κάθε τομής σε ένα πλαίσιο πάνω αριστερά της· όταν είναι απενεργοποιημένο, τα περιγράμματα των τομών εξακολουθούν να εμφανίζονται.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Το χρώμα των περιγραμμάτων των τομών χρήστη και αντικειμένου και των πλαισίων με τους αριθμούς τους· οι αυτόματες τομές χρησιμοποιούν μια πιο αχνή απόχρωσή του.
|
||||
Reset all preferences to their defaults? Επαναφορά όλων των προτιμήσεων στις προεπιλογές τους;
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Οι προεπιλογές εφαρμόζονται όταν κάνετε κλικ στο Εντάξει στις Προτιμήσεις. Το Ακύρωση εκεί διατηρεί τις τρέχουσες προτιμήσεις σας.
|
||||
Restore Recovered Documents Επαναφορά ανακτημένων εγγράφων
|
||||
@@ -4181,6 +4184,9 @@ digits Malayalam Μαλαγιάλαμ
|
||||
No menu item Χωρίς στοιχείο μενού
|
||||
Toolbar Γραμμή εργαλείων
|
||||
{toolbar}, in the {tool} group {toolbar}, στην ομάδα {tool}
|
||||
In the menu bar: {path} Στη γραμμή μενού: {path}
|
||||
In the {group} group: press and hold to open it Στην ομάδα {group}: πατήστε παρατεταμένα για να ανοίξει
|
||||
{home}, not shown now {home}, δεν εμφανίζεται τώρα
|
||||
@plural {n} result|{n} results {n} αποτέλεσμα|{n} αποτελέσματα
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} από {n} αποτέλεσμα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε.|{shown} από {n} αποτελέσματα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε.
|
||||
Recent Commands Πρόσφατες εντολές
|
||||
@@ -5041,6 +5047,7 @@ digits Malayalam Μαλαγιάλαμ
|
||||
@msg choose a location for the package επιλέξτε τοποθεσία συσκευασίας
|
||||
@msg clipboard is empty το πρόχειρο είναι κενό
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: τουλάχιστον ένα χρώμα πρέπει να παραμείνει στον πίνακα χρωμάτων
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: το `{k}` ορίζει ένα χρώμα που ορίζει και άλλο κλειδί
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: το `{h}` δεν είναι έγκυρο χρώμα, όπως το "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: επιτρέπονται το πολύ {MAX_TABLE} χρώματα
|
||||
@msg command `{0}` is not available right now: {1} η εντολή `{0}` δεν είναι διαθέσιμη αυτήν τη στιγμή: {1}
|
||||
@@ -7790,6 +7797,7 @@ breakText Glyphs Γλύφοι
|
||||
@msg One path lies inside the other, so they have no common tangents Η μία διαδρομή βρίσκεται μέσα στην άλλη, επομένως δεν έχουν κοινές εφαπτόμενες
|
||||
@msg The paths overlap, so they have no internal tangents Οι διαδρομές επικαλύπτονται, επομένως δεν έχουν εσωτερικές εφαπτόμενες
|
||||
@msg One path lies inside the other, so they have no internal tangents Η μία διαδρομή βρίσκεται μέσα στην άλλη, επομένως δεν έχουν εσωτερικές εφαπτόμενες
|
||||
@msg The point lies inside the path, so it has no tangents Το σημείο βρίσκεται μέσα στη διαδρομή, επομένως δεν έχει εφαπτόμενες
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Επέκταση παυλών σε διαδρομές
|
||||
@msg select paths with dashed strokes to expand επιλέξτε διαδρομές με διακεκομμένο περίγραμμα για επέκταση
|
||||
@@ -8297,4 +8305,9 @@ breakText Glyphs Γλύφοι
|
||||
@msg A joint does not close by {gap} pt. Μια ένωση δεν κλείνει κατά {gap} pt.
|
||||
@msg Two panels pass through each other. Δύο πάνελ διαπερνούν το ένα το άλλο.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine"
|
||||
Pressure Sensitive Ευαίσθητα στην πίεση
|
||||
Flex Ribbon Εύκαμπτη κορδέλα
|
||||
Pulse Stroke Παλμική πινελιά
|
||||
Round Flow Στρογγυλή ροή
|
||||
Chisel Flow Λοξή ροή
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: χρησιμοποιήστε "{_1}" ή "{_2}"
|
||||
|
Can't render this file because it is too large.
|
@@ -819,6 +819,7 @@ font-technology Variable Variables
|
||||
Delete Brush Eliminar pincel
|
||||
Delete Color Eliminar color
|
||||
Restore Generated Table Restaurar tabla generada
|
||||
Unshift All Colors Deshacer cambio de todos los colores
|
||||
Delete Character Style Eliminar estilo de carácter
|
||||
Delete Empty Artboards Eliminar mesas de trabajo vacías
|
||||
Delete Freeform Point Eliminar punto libre
|
||||
@@ -3243,6 +3244,8 @@ digits Malayalam Malayálam
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Cuánto debe acercarse en pantalla el puntero o un punto arrastrado a la ilustración para que las guías inteligentes se ajusten a ella; la distancia es la misma con cualquier zoom.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Ajusta el extremo de un segmento de línea, o un círculo dibujado desde su centro, para que toque una curva cercana.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta el extremo de un segmento de línea para que encuentre un segmento recto cercano en ángulo recto.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Muestra en el lienzo el número de cada sector en un recuadro en su esquina superior izquierda; si está desactivado, los contornos de los sectores siguen visibles.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. El color de los contornos de los sectores de usuario y de objeto y de los recuadros con su número; los sectores automáticos usan un tono más apagado de ese color.
|
||||
Reset all preferences to their defaults? ¿Restablecer todas las preferencias a sus valores predeterminados?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Los valores predeterminados se aplican al hacer clic en Aceptar en Preferencias. Cancelar ahí conserva sus preferencias actuales.
|
||||
Restore Recovered Documents Restaurar documentos recuperados
|
||||
@@ -3475,6 +3478,9 @@ digits Malayalam Malayálam
|
||||
No menu item Sin elemento de menú
|
||||
Toolbar Barra de herramientas
|
||||
{toolbar}, in the {tool} group {toolbar}, en el grupo {tool}
|
||||
In the menu bar: {path} En la barra de menús: {path}
|
||||
In the {group} group: press and hold to open it En el grupo {group}: mantén pulsado para abrirlo
|
||||
{home}, not shown now {home}, no se muestra ahora
|
||||
@plural {n} result|{n} results {n} resultado|{n} resultados
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Sigue escribiendo para acotarlos.|{shown} de {n} resultados. Sigue escribiendo para acotarlos.
|
||||
Recent Commands Comandos recientes
|
||||
@@ -5091,6 +5097,7 @@ liquify-list-end {0}, {1} {0}, {1}
|
||||
@msg choose a location for the package elige una ubicación para el paquete
|
||||
@msg clipboard is empty el portapapeles está vacío
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: al menos un color debe quedar en la tabla de colores
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` indica un color que también indica otra clave
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` no es un color como "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: como máximo {MAX_TABLE} colores
|
||||
@msg command `{0}` is not available right now: {1} el comando `{0}` no está disponible ahora: {1}
|
||||
@@ -7778,6 +7785,7 @@ breakText Glyphs Glifos
|
||||
@msg One path lies inside the other, so they have no common tangents Un trazado está dentro del otro, por lo que no tienen tangentes comunes
|
||||
@msg The paths overlap, so they have no internal tangents Los trazados se superponen, por lo que no tienen tangentes internas
|
||||
@msg One path lies inside the other, so they have no internal tangents Un trazado está dentro del otro, por lo que no tienen tangentes internas
|
||||
@msg The point lies inside the path, so it has no tangents El punto está dentro del trazado, por lo que no tiene tangentes
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Expandir guiones en trazados
|
||||
@msg select paths with dashed strokes to expand seleccione trazados con trazo discontinuo para expandir
|
||||
@@ -8284,4 +8292,9 @@ breakText Glyphs Glifos
|
||||
@msg A joint does not close by {gap} pt. Una unión no cierra por {gap} pt.
|
||||
@msg Two panels pass through each other. Dos paneles se atraviesan entre sí.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
Pressure Sensitive Sensible a la presión
|
||||
Flex Ribbon Cinta flexible
|
||||
Pulse Stroke Trazo pulsante
|
||||
Round Flow Flujo redondo
|
||||
Chisel Flow Flujo biselado
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: use "{_1}" o "{_2}"
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -3530,6 +3530,7 @@ theme Appearance Ulkoasu
|
||||
Delete Brush Poista sivellin
|
||||
Delete Color Poista väri
|
||||
Restore Generated Table Palauta luotu taulukko
|
||||
Unshift All Colors Peru kaikkien värien siirto
|
||||
Delete Symbol Poista symboli
|
||||
Delete the selected symbol? Poistetaanko valittu symboli?
|
||||
Delete the selected symbols? Poistetaanko valitut symbolit?
|
||||
@@ -4506,6 +4507,9 @@ font-technology Variable Muuttuvat
|
||||
No menu item Ei valikkokohdetta
|
||||
Toolbar Työkalurivi
|
||||
{toolbar}, in the {tool} group {toolbar}, ryhmässä {tool}
|
||||
In the menu bar: {path} Valikkorivillä: {path}
|
||||
In the {group} group: press and hold to open it Ryhmässä {group}: avaa painamalla pitkään
|
||||
{home}, not shown now {home}, ei näkyvissä nyt
|
||||
@plural {n} result|{n} results {n} tulos|{n} tulosta
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown}/{n} tulosta. Kirjoita lisää rajataksesi tuloksia.|{shown}/{n} tulosta. Kirjoita lisää rajataksesi tuloksia.
|
||||
Recent Commands Viimeisimmät komennot
|
||||
@@ -4623,6 +4627,8 @@ font-technology Variable Muuttuvat
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Kuinka lähelle grafiikkaa osoittimen tai vedettävän pisteen on tultava näytöllä, jotta älykkäät apuviivat kohdistavat siihen; etäisyys on sama kaikilla zoomauksilla.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Kohdistaa janan pään tai keskipisteestä piirretyn ympyrän niin, että se koskettaa lähellä olevaa käyrää.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Kohdistaa janan pään niin, että se kohtaa lähellä olevan suoran segmentin suorassa kulmassa.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Näyttää piirtopinnalla kunkin viipaleen numeron ruudussa sen vasemmassa yläkulmassa; kun asetus on pois päältä, viipaleiden ääriviivat näkyvät edelleen.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Käyttäjä- ja objektiviipaleiden ääriviivojen ja niiden numeroruutujen väri; automaattiset viipaleet käyttävät siitä himmeämpää sävyä.
|
||||
Reset all preferences to their defaults? Palautetaanko kaikki asetukset oletuksiin?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Oletukset otetaan käyttöön, kun valitset Asetuksissa OK. Peruuta siellä säilyttää nykyiset asetuksesi.
|
||||
Smaller ↔ Larger Pienempi ↔ Suurempi
|
||||
@@ -5307,6 +5313,7 @@ liquify-list-end {0}, {1} {0} ja {1}
|
||||
@msg choose a location for the package valitse paketin sijainti
|
||||
@msg clipboard is empty leikepöytä on tyhjä
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: väritaulukkoon on jäätävä vähintään yksi väri
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` nimeää värin, jonka myös toinen avain nimeää
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` ei ole väri, kuten "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: enintään {MAX_TABLE} väriä
|
||||
@msg command `{0}` is not available right now: {1} komento `{0}` ei ole nyt käytettävissä: {1}
|
||||
@@ -7866,6 +7873,7 @@ breakText Glyphs Merkit
|
||||
@msg One path lies inside the other, so they have no common tangents Toinen polku on toisen sisällä, joten niillä ei ole yhteisiä tangentteja
|
||||
@msg The paths overlap, so they have no internal tangents Polut ovat päällekkäin, joten niillä ei ole sisäisiä tangentteja
|
||||
@msg One path lies inside the other, so they have no internal tangents Toinen polku on toisen sisällä, joten niillä ei ole sisäisiä tangentteja
|
||||
@msg The point lies inside the path, so it has no tangents Piste on polun sisällä, joten sillä ei ole tangentteja
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Laajenna viivat poluiksi
|
||||
@msg select paths with dashed strokes to expand valitse laajennettavat polut, joissa on katkoviiva
|
||||
@@ -8380,4 +8388,9 @@ breakText Glyphs Merkit
|
||||
@msg A joint does not close by {gap} pt. Liitos ei sulkeudu, rako {gap} pt.
|
||||
@msg Two panels pass through each other. Kaksi paneelia kulkee toistensa läpi.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine"
|
||||
Pressure Sensitive Paineherkkä
|
||||
Flex Ribbon Joustava nauha
|
||||
Pulse Stroke Sykkivä veto
|
||||
Round Flow Pyöreä veto
|
||||
Chisel Flow Viisto veto
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: käytä arvoa "{_1}" tai "{_2}"
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -821,6 +821,7 @@ font-technology Variable Variables
|
||||
Delete Brush Supprimer la forme
|
||||
Delete Color Supprimer la couleur
|
||||
Restore Generated Table Restaurer la table générée
|
||||
Unshift All Colors Annuler le décalage de toutes les couleurs
|
||||
Delete Character Style Supprimer le style de caractère
|
||||
Delete Empty Artboards Supprimer les plans de travail vides
|
||||
Delete Freeform Point Supprimer le point libre
|
||||
@@ -3231,6 +3232,8 @@ digits Malayalam Malayalam
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. La distance à l’écran à laquelle le pointeur ou un point déplacé doit approcher une illustration pour que les repères commentés s’y aimantent. Elle est la même à tous les zooms.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Aimante l’extrémité d’un segment de droite, ou un cercle tracé depuis son centre, pour qu’il touche une courbe proche.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Aimante l’extrémité d’un segment de droite pour qu’il rencontre un segment droit proche à angle droit.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Affiche sur la zone de travail le numéro de chaque tranche dans un cadre en haut à gauche de la tranche. Désactivée, les contours des tranches restent affichés.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. La couleur des contours des tranches utilisateur et objet et de leurs cadres de numéro. Les tranches automatiques utilisent une nuance plus terne de cette couleur.
|
||||
Reset all preferences to their defaults? Rétablir toutes les préférences à leur valeur par défaut ?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Les valeurs par défaut sont appliquées lorsque vous cliquez sur OK dans Préférences. Annuler y conserve vos préférences actuelles.
|
||||
Restore Recovered Documents Restaurer les documents récupérés
|
||||
@@ -3463,6 +3466,9 @@ digits Malayalam Malayalam
|
||||
No menu item Aucun élément de menu
|
||||
Toolbar Barre d’outils
|
||||
{toolbar}, in the {tool} group {toolbar}, dans le groupe {tool}
|
||||
In the menu bar: {path} Dans la barre des menus, sous {path}
|
||||
In the {group} group: press and hold to open it Dans le groupe {group}, maintenez enfoncé pour l’ouvrir
|
||||
{home}, not shown now {home}, non affiché pour l’instant
|
||||
@plural {n} result|{n} results {n} résultat|{n} résultats
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} sur {n} résultat. Continuez à taper pour les affiner.|{shown} sur {n} résultats. Continuez à taper pour les affiner.
|
||||
Recent Commands Commandes récentes
|
||||
@@ -5050,6 +5056,7 @@ liquify-list-end {0}, {1} {0} et {1}
|
||||
@msg choose a location for the package choisissez un emplacement pour l’assemblage
|
||||
@msg clipboard is empty le presse-papiers est vide
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: au moins une couleur doit rester dans la table des couleurs
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` désigne une couleur qu’une autre clé désigne aussi
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what} : `{h}` n’est pas une couleur comme "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what} : {MAX_TABLE} couleurs au maximum
|
||||
@msg command `{0}` is not available right now: {1} la commande `{0}` n’est pas disponible pour le moment : {1}
|
||||
@@ -7798,6 +7805,7 @@ breakText Glyphs Glyphes
|
||||
@msg One path lies inside the other, so they have no common tangents Un tracé se trouve à l’intérieur de l’autre : ils n’ont donc aucune tangente commune
|
||||
@msg The paths overlap, so they have no internal tangents Les tracés se chevauchent : ils n’ont donc aucune tangente interne
|
||||
@msg One path lies inside the other, so they have no internal tangents Un tracé se trouve à l’intérieur de l’autre : ils n’ont donc aucune tangente interne
|
||||
@msg The point lies inside the path, so it has no tangents Le point se trouve à l’intérieur du tracé et n’a donc aucune tangente
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Décomposer les tirets en tracés
|
||||
@msg select paths with dashed strokes to expand sélectionnez des tracés à contour pointillé à décomposer
|
||||
@@ -10104,3 +10112,8 @@ breakText Glyphs Glyphes
|
||||
@msg A joint does not close by {gap} pt. Un joint ne se ferme pas, avec un écart de {gap} pt.
|
||||
@msg Two panels pass through each other. Deux panneaux se traversent.
|
||||
@msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution
|
||||
Pressure Sensitive Sensible à la pression
|
||||
Flex Ribbon Ruban souple
|
||||
Pulse Stroke Trait pulsé
|
||||
Round Flow Flux rond
|
||||
Chisel Flow Flux biseauté
|
||||
|
Can't render this file because it is too large.
|
@@ -924,6 +924,7 @@
|
||||
Delete Brush બ્રશ કાઢી નાખો
|
||||
Delete Color રંગ કાઢી નાખો
|
||||
Restore Generated Table જનરેટ થયેલું ટેબલ પુનઃસ્થાપિત કરો
|
||||
Unshift All Colors બધા રંગોનું શિફ્ટ રદ કરો
|
||||
Delete Character Style અક્ષર સ્ટાઇલ કાઢી નાખો
|
||||
Delete Data Set ડેટા સેટ કાઢી નાખો
|
||||
Delete Data Sets ડેટા સેટ્સ કાઢી નાખો
|
||||
@@ -3085,6 +3086,7 @@
|
||||
@msg One path lies inside the other, so they have no common tangents એક પાથ બીજાની અંદર છે, તેથી તેમની કોઈ સામાન્ય સ્પર્શરેખા નથી
|
||||
@msg The paths overlap, so they have no internal tangents પાથ એકબીજા પર ચઢેલા છે, તેથી તેમની કોઈ આંતરિક સ્પર્શરેખા નથી
|
||||
@msg One path lies inside the other, so they have no internal tangents એક પાથ બીજાની અંદર છે, તેથી તેમની કોઈ આંતરિક સ્પર્શરેખા નથી
|
||||
@msg The point lies inside the path, so it has no tangents બિંદુ પાથની અંદર છે, તેથી તેની કોઈ સ્પર્શરેખા નથી
|
||||
Remove Guide ગાઇડ દૂર કરો
|
||||
Remove Item આઇટમ દૂર કરો
|
||||
Remove JavaScript File JavaScript ફાઇલ દૂર કરો
|
||||
@@ -3302,6 +3304,8 @@
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. સ્માર્ટ ગાઇડ સ્નેપ કરે તે માટે પોઇન્ટર અથવા ખેંચેલું બિંદુ સ્ક્રીન પર આર્ટની કેટલું નજીક આવવું જોઈએ; આ અંતર દરેક ઝૂમ પર સમાન રહે છે.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. લાઇન સેગમેન્ટના છેડાને, અથવા કેન્દ્રથી દોરેલા વર્તુળને, એ રીતે સ્નેપ કરે છે કે તે નજીકના વળાંકને સ્પર્શે.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. લાઇન સેગમેન્ટના છેડાને એ રીતે સ્નેપ કરે છે કે તે નજીકના સીધા સેગમેન્ટને કાટખૂણે મળે.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. કેનવાસ પર દરેક સ્લાઇસનો નંબર તેના ઉપરના ડાબા ખૂણે એક બૉક્સમાં બતાવે છે; બંધ હોય ત્યારે પણ સ્લાઇસની રૂપરેખાઓ દેખાય છે.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. યુઝર અને ઑબ્જેક્ટ સ્લાઇસની રૂપરેખાઓ અને તેમના નંબર બૉક્સનો રંગ; ઑટો સ્લાઇસ તેની ઝાંખી છાયા વાપરે છે.
|
||||
Restored documents open unsaved: save them to keep them. પુનઃસ્થાપિત દસ્તાવેજો અસાચવેલા ખુલશે: તેમને રાખવા માટે સાચવો.
|
||||
Restrict printing, editing and other tasks છાપકામ, સંપાદન અને અન્ય કાર્યો પર પ્રતિબંધ મૂકો
|
||||
Reticulation… રેટિક્યુલેશન…
|
||||
@@ -3572,6 +3576,9 @@
|
||||
No menu item કોઈ મેનૂ આઇટમ નથી
|
||||
Toolbar ટૂલબાર
|
||||
{toolbar}, in the {tool} group {toolbar}, {tool} જૂથમાં
|
||||
In the menu bar: {path} મેનૂ બારમાં: {path}
|
||||
In the {group} group: press and hold to open it {group} જૂથમાં: ખોલવા માટે દબાવીને પકડી રાખો
|
||||
{home}, not shown now {home}, હમણાં બતાવેલ નથી
|
||||
Tool ટૂલ
|
||||
Command કમાન્ડ
|
||||
Panel પેનલ
|
||||
@@ -5106,3 +5113,8 @@ swatch [Registration] [રજિસ્ટ્રેશન]
|
||||
Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર
|
||||
Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine"
|
||||
Pressure Sensitive દબાણ સંવેદનશીલ
|
||||
Flex Ribbon લવચીક પટ્ટી
|
||||
Pulse Stroke ધબકતો ઘસારો
|
||||
Round Flow ગોળ પ્રવાહ
|
||||
Chisel Flow ત્રાંસો પ્રવાહ
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -1319,6 +1319,7 @@ antiAlias Sharp शार्प
|
||||
Delete Brush ब्रश हटाएँ
|
||||
Delete Color रंग हटाएँ
|
||||
Restore Generated Table जनरेट की गई तालिका पुनर्स्थापित करें
|
||||
Unshift All Colors सभी रंग अनशिफ़्ट करें
|
||||
Delete Character Style कैरेक्टर स्टाइल हटाएँ
|
||||
Delete Data Set डेटा सेट हटाएँ
|
||||
Delete Data Sets डेटा सेट्स हटाएँ
|
||||
@@ -4356,6 +4357,8 @@ antiAlias Sharp शार्प
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. स्मार्ट गाइड्स के स्नैप करने के लिए पॉइंटर या ड्रैग किया गया पॉइंट स्क्रीन पर आर्ट के कितने पास आना चाहिए; यह दूरी हर ज़ूम पर समान रहती है।
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. लाइन सेगमेंट के सिरे को, या केंद्र से ड्रॉ किए गए वृत्त को, इस तरह स्नैप करता है कि वह पास के वक्र को छुए।
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. लाइन सेगमेंट के सिरे को इस तरह स्नैप करता है कि वह पास के सीधे सेगमेंट से समकोण पर मिले।
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. कैनवास पर हर स्लाइस का नंबर उसके ऊपरी बाएँ कोने में एक बॉक्स में दिखाता है; बंद होने पर भी स्लाइस की आउटलाइन दिखती रहती हैं।
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. यूज़र और ऑब्जेक्ट स्लाइस की आउटलाइन और उनके नंबर बॉक्स का रंग; ऑटो स्लाइस इसकी हल्की छाया इस्तेमाल करते हैं।
|
||||
Reset all preferences to their defaults? सभी प्रेफ़रेंसेज़ को उनके डिफ़ॉल्ट पर रीसेट करें?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. डिफ़ॉल्ट तब लागू होते हैं जब आप प्रेफ़रेंसेज़ में ठीक है पर क्लिक करते हैं। वहाँ रद्द करें आपकी मौजूदा प्रेफ़रेंसेज़ बनाए रखता है।
|
||||
Restore Recovered Documents पुनर्स्थापना डॉक्यूमेंट
|
||||
@@ -4657,6 +4660,9 @@ antiAlias Sharp शार्प
|
||||
No menu item कोई मेनू आइटम नहीं
|
||||
Toolbar टूलबार
|
||||
{toolbar}, in the {tool} group {toolbar}, {tool} समूह में
|
||||
In the menu bar: {path} मेनू बार में: {path}
|
||||
In the {group} group: press and hold to open it {group} समूह में: खोलने के लिए दबाकर रखें
|
||||
{home}, not shown now {home}, अभी नहीं दिखाया गया
|
||||
@plural {n} result|{n} results {n} परिणाम|{n} परिणाम
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें।|{n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें।
|
||||
Recent Commands हाल के आदेश
|
||||
@@ -6980,6 +6986,7 @@ antiAlias Sharp शार्प
|
||||
@msg colorMode must be rgb or cmyk, not `{m}` colorMode को rgb या cmyk होना चाहिए, `{m}` नहीं
|
||||
@msg colorModel must be {own} (the document's mode), grayscale or bitmap colorModel को {own} (डॉक्यूमेंट का मोड), grayscale या bitmap होना चाहिए
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: रंग तालिका में कम से कम एक रंग रहना चाहिए
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` वही रंग बताता है जो कोई दूसरी कुंजी भी बताती है
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}`, "#ff8800" जैसा रंग नहीं है
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: अधिकतम {MAX_TABLE} रंग
|
||||
@msg colour groups can't go into colour groups रंग समूह रंग समूहों में नहीं जा सकते हैं
|
||||
@@ -8457,6 +8464,7 @@ liquify-list-end {0}, {1} {0} और {1}
|
||||
@msg One path lies inside the other, so they have no common tangents एक पाथ दूसरे के अंदर है, इसलिए उनकी कोई उभयनिष्ठ स्पर्शरेखा नहीं है
|
||||
@msg The paths overlap, so they have no internal tangents पाथ एक-दूसरे पर चढ़े हुए हैं, इसलिए उनकी कोई आंतरिक स्पर्शरेखा नहीं है
|
||||
@msg One path lies inside the other, so they have no internal tangents एक पाथ दूसरे के अंदर है, इसलिए उनकी कोई आंतरिक स्पर्शरेखा नहीं है
|
||||
@msg The point lies inside the path, so it has no tangents बिंदु पाथ के अंदर है, इसलिए उसकी कोई स्पर्शरेखा नहीं है
|
||||
@msg select plain rectangles, ellipses or regular polygons to convert बदलने के लिए सादे आयत, अंडाकार या नियमित बहुभुजों सिलेक्ट करें
|
||||
@msg Select point type पॉइंट टाइप सिलेक्ट करें
|
||||
@msg select two or three paths or compound paths दो या तीन पाथ या यौगिक पाथ सिलेक्ट करें
|
||||
@@ -9714,6 +9722,11 @@ theme Appearance अपीयरेंस
|
||||
@msg A panel is not joined to the rest by a crease. कोई पैनल किसी क्रीज़ लाइन से बाकी से जुड़ा नहीं है।
|
||||
@msg A fold line is on a non-printing layer. एक फ़ोल्ड लाइन नॉन-प्रिंटिंग लेयर पर है।
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} पैनल: {panels}, हिंज: {hinges}, एरर: {errors}, वॉर्निंग: {warnings}
|
||||
Pressure Sensitive दबाव संवेदनशील
|
||||
Flex Ribbon लचीला फीता
|
||||
Pulse Stroke स्पंदित रेखा
|
||||
Round Flow गोल प्रवाह
|
||||
Chisel Flow तिरछा प्रवाह
|
||||
Fold Preview फ़ोल्ड प्रीव्यू
|
||||
Fold फ़ोल्ड
|
||||
Show Fold Lines फ़ोल्ड लाइनें दिखाएँ
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1048,6 +1048,7 @@ font-technology Variable Változó
|
||||
Delete Brush Ecset törlése
|
||||
Delete Color Szín törlése
|
||||
Restore Generated Table Előállított tábla visszaállítása
|
||||
Unshift All Colors Az összes szín eltolásának visszavonása
|
||||
Delete Character Style Karakterstílus törlése
|
||||
Delete Data Set Adatkészlet törlése
|
||||
Delete Empty Artboards Üres rajztáblák törlése
|
||||
@@ -3824,6 +3825,8 @@ mark-style Japanese Japán
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Milyen közel kell a mutatónak vagy egy húzott pontnak a képernyőn a grafikához érnie, hogy az intelligens segédvonalak illesszenek; a távolság minden nagyításnál azonos.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Egy szakasz végét vagy a középpontjából rajzolt kört úgy illeszti, hogy érintse a közeli görbét.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Egy szakasz végét úgy illeszti, hogy derékszögben találkozzon egy közeli egyenes szakasszal.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. A vásznon minden szelet számát egy keretben mutatja a szelet bal felső sarkában; kikapcsolva a szeletek körvonalai továbbra is látszanak.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. A felhasználói és objektumszeletek körvonalainak és számkereteinek színe; az automatikus szeletek ennek egy halványabb árnyalatát használják.
|
||||
Reset all preferences to their defaults? Visszaállítja az összes beállítást az alapértékre?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Az alapértékek akkor lépnek életbe, amikor a Beállításokban az OK gombra kattint. Az ottani Mégse megtartja a jelenlegi beállításokat.
|
||||
Restore Recovered Documents Helyreállított dokumentumok visszaállítása
|
||||
@@ -4098,6 +4101,9 @@ mark-style Japanese Japán
|
||||
No menu item Nincs menüpont
|
||||
Toolbar Eszköztár
|
||||
{toolbar}, in the {tool} group {toolbar}, a(z) {tool} csoportjában
|
||||
In the menu bar: {path} A menüsorban: {path}
|
||||
In the {group} group: press and hold to open it A(z) {group} csoportban: a megnyitáshoz nyomja le és tartsa lenyomva
|
||||
{home}, not shown now {home}, most nem látható
|
||||
@plural {n} result|{n} results {n} találat
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} találatból {shown} látható. Gépeljen tovább a szűkítéshez.
|
||||
Recent Commands Legutóbbi parancsok
|
||||
@@ -5454,6 +5460,7 @@ imageTrace Outline Körvonal
|
||||
@msg clipboard is empty a vágólap üres
|
||||
@msg closing needs three anchors a lezáráshoz három horgonypont kell
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: legalább egy színnek a színtáblában kell maradnia
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: a(z) `{k}` olyan színt nevez meg, amelyet egy másik kulcs is megnevez
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` nem szín (például "#ff8800")
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: legfeljebb {MAX_TABLE} szín
|
||||
@msg column must be true or a number from 1 a column értéke true vagy 1-től kezdődő szám lehet
|
||||
@@ -7787,6 +7794,7 @@ breakText Glyphs Glifák
|
||||
@msg One path lies inside the other, so they have no common tangents Az egyik útvonal a másikon belül van, így nincsenek közös érintőik
|
||||
@msg The paths overlap, so they have no internal tangents Az útvonalak átfedik egymást, így nincsenek belső érintőik
|
||||
@msg One path lies inside the other, so they have no internal tangents Az egyik útvonal a másikon belül van, így nincsenek belső érintőik
|
||||
@msg The point lies inside the path, so it has no tangents A pont az útvonalon belül van, így nincsenek érintői
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Szaggatások kibontása útvonalakká
|
||||
@msg select paths with dashed strokes to expand jelöljön ki szaggatott körvonalú útvonalakat a kibontáshoz
|
||||
@@ -10096,6 +10104,11 @@ breakText Glyphs Glifák
|
||||
@msg A panel is not joined to the rest by a crease. Egy panelt egyetlen bigvonal sem köt a többihez.
|
||||
@msg A fold line is on a non-printing layer. Egy hajtásvonal nem nyomtatható rétegen van.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelek: {panels}, zsanérok: {hinges}, hibák: {errors}, figyelmeztetések: {warnings}
|
||||
Pressure Sensitive Nyomásérzékeny
|
||||
Flex Ribbon Rugalmas szalag
|
||||
Pulse Stroke Lüktető vonás
|
||||
Round Flow Kerek vonás
|
||||
Chisel Flow Ferde vonás
|
||||
Fold Preview Hajtás előnézete
|
||||
Fold Hajtás
|
||||
Show Fold Lines Hajtásvonalak megjelenítése
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3262,6 +3262,7 @@ theme Appearance Tampilan
|
||||
Delete Brush Hapus kuas
|
||||
Delete Color Hapus warna
|
||||
Restore Generated Table Pulihkan tabel yang dibuat
|
||||
Unshift All Colors Batalkan pergeseran semua warna
|
||||
Delete Symbol Hapus simbol
|
||||
Delete the selected symbol? Hapus simbol yang dipilih?
|
||||
Delete the selected symbols? Hapus simbol yang dipilih?
|
||||
@@ -4231,6 +4232,9 @@ font-technology Variable Variabel
|
||||
No menu item Tidak ada item menu
|
||||
Toolbar Bilah alat
|
||||
{toolbar}, in the {tool} group {toolbar}, dalam grup {tool}
|
||||
In the menu bar: {path} Di bilah menu: {path}
|
||||
In the {group} group: press and hold to open it Di grup {group}: tekan dan tahan untuk membukanya
|
||||
{home}, not shown now {home}, tidak ditampilkan sekarang
|
||||
@plural {n} result|{n} results {n} hasil
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} dari {n} hasil. Terus ketik untuk mempersempitnya.
|
||||
Recent Commands Perintah terbaru
|
||||
@@ -4348,6 +4352,8 @@ font-technology Variable Variabel
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Seberapa dekat penunjuk atau titik yang diseret harus mendekati karya di layar agar panduan cerdas menjepret; jaraknya sama pada setiap zoom.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Menjepretkan ujung segmen garis, atau lingkaran yang digambar dari pusatnya, agar menyentuh kurva di dekatnya.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Menjepretkan ujung segmen garis agar bertemu segmen lurus di dekatnya pada sudut siku-siku.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Menampilkan nomor setiap irisan dalam kotak di sudut kiri atasnya di kanvas; saat nonaktif, garis tepi irisan tetap ditampilkan.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Warna garis tepi irisan pengguna dan objek serta kotak nomornya; irisan otomatis memakai nuansa yang lebih redup dari warna ini.
|
||||
Reset all preferences to their defaults? Atur ulang semua preferensi ke defaultnya?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Nilai default diterapkan saat Anda mengklik OK di Preferensi. Batal di sana mempertahankan preferensi Anda saat ini.
|
||||
Smaller ↔ Larger Lebih kecil ↔ Lebih besar
|
||||
@@ -4791,6 +4797,7 @@ imageTrace Outline Kontur
|
||||
@msg choose a location for the package pilih lokasi untuk paket
|
||||
@msg clipboard is empty papan klip kosong
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: setidaknya satu warna harus tetap ada di tabel warna
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` menyebut warna yang juga disebut kunci lain
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` bukan warna seperti "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: maksimal {MAX_TABLE} warna
|
||||
@msg command `{0}` is not available right now: {1} perintah `{0}` tidak tersedia saat ini: {1}
|
||||
@@ -7045,6 +7052,7 @@ breakText Glyphs Glif
|
||||
@msg One path lies inside the other, so they have no common tangents Satu jalur berada di dalam jalur lainnya, sehingga tidak ada garis singgung persekutuan
|
||||
@msg The paths overlap, so they have no internal tangents Jalur-jalur saling tumpang tindih, sehingga tidak ada garis singgung dalam
|
||||
@msg One path lies inside the other, so they have no internal tangents Satu jalur berada di dalam jalur lainnya, sehingga tidak ada garis singgung dalam
|
||||
@msg The point lies inside the path, so it has no tangents Titik berada di dalam jalur, sehingga tidak ada garis singgung
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Perluas garis putus menjadi jalur
|
||||
@msg select paths with dashed strokes to expand pilih jalur dengan stroke putus-putus yang akan diperluas
|
||||
@@ -7387,3 +7395,8 @@ breakText Glyphs Glif
|
||||
@msg A joint does not close by {gap} pt. Sebuah sambungan tidak menutup sejauh {gap} pt.
|
||||
@msg Two panels pass through each other. Dua panel saling menembus.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine"
|
||||
Pressure Sensitive Peka Tekanan
|
||||
Flex Ribbon Pita Lentur
|
||||
Pulse Stroke Goresan Berdenyut
|
||||
Round Flow Aliran Bulat
|
||||
Chisel Flow Aliran Serong
|
||||
|
Can't render this file because it contains an unexpected character in line 2538 and column 5.
|
@@ -821,6 +821,7 @@ font-technology Variable Variabili
|
||||
Delete Brush Elimina pennello
|
||||
Delete Color Elimina colore
|
||||
Restore Generated Table Ripristina tabella generata
|
||||
Unshift All Colors Annulla spostamento di tutti i colori
|
||||
Delete Character Style Elimina stile carattere
|
||||
Delete Empty Artboards Elimina tavole da disegno vuote
|
||||
Delete Freeform Point Elimina punto libero
|
||||
@@ -3291,6 +3292,8 @@ digits Malayalam Malayalam
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Quanto vicino sullo schermo il puntatore o un punto trascinato deve arrivare alla grafica perché le guide sensibili vi si aggancino; la distanza è la stessa a ogni zoom.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Aggancia l’estremità di un segmento di linea, o un cerchio disegnato dal centro, in modo che tocchi una curva vicina.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Aggancia l’estremità di un segmento di linea in modo che incontri un segmento rettilineo vicino ad angolo retto.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Mostra sull’area di lavoro il numero di ogni sezione in un riquadro nel suo angolo in alto a sinistra; se è disattivata, i contorni delle sezioni restano visibili.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Il colore dei contorni delle sezioni utente e oggetto e dei riquadri con il loro numero; le sezioni automatiche usano una tonalità più tenue di questo colore.
|
||||
Reset all preferences to their defaults? Ripristinare tutte le preferenze ai valori predefiniti?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. I valori predefiniti vengono applicati quando fai clic su OK in Preferenze. Annulla lì mantiene le preferenze attuali.
|
||||
Restore Recovered Documents Ripristina documenti recuperati
|
||||
@@ -3525,6 +3528,9 @@ digits Malayalam Malayalam
|
||||
No menu item Nessuna voce di menu
|
||||
Toolbar Barra degli strumenti
|
||||
{toolbar}, in the {tool} group {toolbar}, nel gruppo {tool}
|
||||
In the menu bar: {path} Nella barra dei menu: {path}
|
||||
In the {group} group: press and hold to open it Nel gruppo {group}: tieni premuto per aprirlo
|
||||
{home}, not shown now {home}, ora non visibile
|
||||
Tool Strumento
|
||||
Command Comando
|
||||
@plural {n} result|{n} results {n} risultato|{n} risultati
|
||||
@@ -5117,6 +5123,7 @@ liquify-list-end {0}, {1} {0} e {1}
|
||||
@msg choose a location for the package scegli una posizione per il pacchetto
|
||||
@msg clipboard is empty gli appunti sono vuoti
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: almeno un colore deve restare nella tabella colori
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` indica un colore indicato anche da un’altra chiave
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` non è un colore come "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: al massimo {MAX_TABLE} colori
|
||||
@msg command `{0}` is not available right now: {1} il comando `{0}` non è disponibile in questo momento: {1}
|
||||
@@ -7429,6 +7436,7 @@ breakText Glyphs Glifi
|
||||
@msg One path lies inside the other, so they have no common tangents Un tracciato si trova dentro l’altro, quindi non hanno tangenti comuni
|
||||
@msg The paths overlap, so they have no internal tangents I tracciati si sovrappongono, quindi non hanno tangenti interne
|
||||
@msg One path lies inside the other, so they have no internal tangents Un tracciato si trova dentro l’altro, quindi non hanno tangenti interne
|
||||
@msg The point lies inside the path, so it has no tangents Il punto si trova dentro il tracciato, quindi non ha tangenti
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Espandi trattini in tracciati
|
||||
@msg select paths with dashed strokes to expand seleziona tracciati con traccia tratteggiata da espandere
|
||||
@@ -9747,6 +9755,11 @@ breakText Glyphs Glifi
|
||||
@msg A panel is not joined to the rest by a crease. Un pannello non è unito al resto da alcuna linea di cordonatura.
|
||||
@msg A fold line is on a non-printing layer. Una linea di piega si trova su un livello non stampabile.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Pannelli: {panels}, cerniere: {hinges}, errori: {errors}, avvisi: {warnings}
|
||||
Pressure Sensitive Sensibile alla pressione
|
||||
Flex Ribbon Nastro flessibile
|
||||
Pulse Stroke Tratto pulsante
|
||||
Round Flow Flusso tondo
|
||||
Chisel Flow Flusso obliquo
|
||||
Fold Preview Anteprima piegatura
|
||||
Fold Piegatura
|
||||
Show Fold Lines Mostra linee di piega
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1522,6 +1522,7 @@ antiAlias Sharp シャープ
|
||||
Delete Brush ブラシを削除
|
||||
Delete Color カラーを削除
|
||||
Restore Generated Table 生成されたテーブルを復元
|
||||
Unshift All Colors すべてのカラーのシフトを戻す
|
||||
Delete Character Style 文字スタイルを削除
|
||||
Delete Empty Artboards 空のアートボードを削除
|
||||
Delete Freeform Point フリーフォームポイントを削除
|
||||
@@ -3275,6 +3276,8 @@ mark-style Japanese 日本式
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. スマートガイドがスナップするために、ポインターやドラッグしたポイントが画面上でアートにどこまで近づく必要があるかです。この距離はどのズームでも同じです。
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 直線セグメントの端、または中心から描いた円を、近くの曲線に接するようにスナップします。
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 直線セグメントの端を、近くの直線セグメントと直角に交わるようにスナップします。
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. カンバス上で、各スライスの番号をスライスの左上のボックスに表示します。オフでもスライスの輪郭は表示されます。
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. ユーザースライスとオブジェクトスライスの輪郭、およびその番号のボックスの色です。自動スライスにはこの色の淡い色合いが使われます。
|
||||
Reset all preferences to their defaults? すべての環境設定を初期値に戻しますか?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 初期値は環境設定で OK をクリックすると適用されます。そこでキャンセルすると現在の環境設定が保たれます。
|
||||
Restored documents open unsaved: save them to keep them. 復元したドキュメントは未保存の状態で開きます。保存して残してください。
|
||||
@@ -3410,6 +3413,9 @@ mark-style Japanese 日本式
|
||||
No menu item メニュー項目なし
|
||||
Toolbar ツールバー
|
||||
{toolbar}, in the {tool} group {toolbar}、{tool} のグループ内
|
||||
In the menu bar: {path} メニューバー: {path}
|
||||
In the {group} group: press and hold to open it {group} のグループ内: 長押しで開きます
|
||||
{home}, not shown now {home}、現在は表示されていません
|
||||
@plural {n} result|{n} results {n} 件
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} 件中 {shown} 件。続けて入力すると絞り込めます。
|
||||
Recent Commands 最近使ったコマンド
|
||||
@@ -5080,6 +5086,7 @@ variable-list-end {0}, {1} {0}、{1}
|
||||
@msg paste unavailable 貼り付けを使用できません
|
||||
@msg Save for Web: the image is empty Web 用に保存: 画像が空です
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: カラーテーブルには少なくとも 1 つのカラーを残す必要があります
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` は別のキーと同じカラーを指しています
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` は「#ff8800」のような形式のカラーではありません
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: 指定できるカラーは {MAX_TABLE} 色までです
|
||||
@msg no artboard {i} (0-based; the document has {_1}) アートボード {i} はありません (番号は 0 始まり、このドキュメントには {_1} 個あります)
|
||||
@@ -9319,6 +9326,7 @@ breakText Glyphs 字形
|
||||
@msg One path lies inside the other, so they have no common tangents 一方のパスがもう一方の内側にあるため、共通接線はありません
|
||||
@msg The paths overlap, so they have no internal tangents パスが重なっているため、内側の接線はありません
|
||||
@msg One path lies inside the other, so they have no internal tangents 一方のパスがもう一方の内側にあるため、内側の接線はありません
|
||||
@msg The point lies inside the path, so it has no tangents 点がパスの内側にあるため、接線はありません
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths 破線をパスに拡張
|
||||
@msg select paths with dashed strokes to expand 拡張する破線のパスを選択してください
|
||||
@@ -9812,6 +9820,11 @@ breakText Glyphs 字形
|
||||
@msg A panel is not joined to the rest by a crease. パネルがどの筋入れ線でも他とつながっていません。
|
||||
@msg A fold line is on a non-printing layer. 折り線が印刷しないレイヤーにあります。
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} パネル: {panels}、ヒンジ: {hinges}、エラー: {errors}、警告: {warnings}
|
||||
Pressure Sensitive 筆圧対応
|
||||
Flex Ribbon しなやかなリボン
|
||||
Pulse Stroke 脈打つ線
|
||||
Round Flow 丸筆の流れ
|
||||
Chisel Flow 平筆の流れ
|
||||
Fold Preview 折りプレビュー
|
||||
Fold 折り
|
||||
Show Fold Lines 折り線を表示
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -5356,6 +5356,7 @@ theme Appearance იერსახე
|
||||
Delete Brush ფუნჯის წაშლა
|
||||
Delete Color ფერის წაშლა
|
||||
Restore Generated Table გენერირებული ცხრილის აღდგენა
|
||||
Unshift All Colors ყველა ფერის წანაცვლების მოხსნა
|
||||
Delete Symbol სიმბოლოს წაშლა
|
||||
Delete the selected symbol? წაიშალოს მონიშნული სიმბოლო?
|
||||
Delete the selected symbols? წაიშალოს მონიშნული სიმბოლოები?
|
||||
@@ -6302,6 +6303,9 @@ font-technology Variable ცვლადი
|
||||
No menu item მენიუს ელემენტი არ არის
|
||||
Toolbar ხელსაწყოთა ზოლი
|
||||
{toolbar}, in the {tool} group {toolbar}, ჯგუფში {tool}
|
||||
In the menu bar: {path} მენიუს ზოლში: {path}
|
||||
In the {group} group: press and hold to open it ჯგუფში {group}: გასახსნელად დააჭირეთ და გეჭიროთ
|
||||
{home}, not shown now {home}, ახლა არ ჩანს
|
||||
@plural {n} result|{n} results {n} შედეგი
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} შედეგიდან {shown}. გააგრძელეთ აკრეფა მათ შესამცირებლად.
|
||||
Recent Commands ბოლოდროინდელი ბრძანებები
|
||||
@@ -6420,6 +6424,8 @@ font-technology Variable ცვლადი
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. რამდენად ახლოს უნდა მივიდეს ეკრანზე მაჩვენებელი ან გადათრეული წერტილი გრაფიკასთან, რომ ჭკვიანმა დამხმარე ხაზებმა მიაბან; მანძილი ყველა მასშტაბზე ერთნაირია.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. ხაზის სეგმენტის ბოლოს, ან ცენტრიდან დახატულ წრეწირს, ისე აბამს, რომ ახლომდებარე მრუდს შეეხოს.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. ხაზის სეგმენტის ბოლოს ისე აბამს, რომ ახლომდებარე სწორ სეგმენტს მართი კუთხით შეხვდეს.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. ტილოზე თითოეული ნაჭრის ნომერს აჩვენებს ჩარჩოში მის ზედა მარცხენა კუთხეში; გამორთულისას ნაჭრების კონტურები კვლავ ჩანს.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. მომხმარებლისა და ობიექტის ნაჭრების კონტურებისა და მათი ნომრების ჩარჩოების ფერი; ავტომატური ნაჭრები ამ ფერის უფრო მკრთალ ელფერს იყენებს.
|
||||
Reset all preferences to their defaults? დავაბრუნოთ ყველა პარამეტრი ნაგულისხმევ მნიშვნელობებზე?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. ნაგულისხმევი მნიშვნელობები გამოიყენება, როცა პარამეტრებში OK-ს დააჭერთ. იქ გაუქმება ინარჩუნებს თქვენს მიმდინარე პარამეტრებს.
|
||||
Smaller ↔ Larger უფრო პატარა ↔ უფრო დიდი
|
||||
@@ -6858,6 +6864,7 @@ font-technology Variable ცვლადი
|
||||
@msg choose a location for the package აირჩიეთ შეფუთვის მდებარეობა
|
||||
@msg clipboard is empty გაცვლის ბუფერი ცარიელია
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: ფერების ცხრილში ერთი ფერი მაინც უნდა დარჩეს
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` ასახელებს ფერს, რომელსაც სხვა გასაღებიც ასახელებს
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` ფერი არ არის, მაგალითად "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: არაუმეტეს {MAX_TABLE} ფერი
|
||||
@msg command `{0}` is not available right now: {1} ბრძანება `{0}` ახლა ხელმისაწვდომი არ არის: {1}
|
||||
@@ -10000,6 +10007,7 @@ breakText Glyphs გლიფები
|
||||
@msg One path lies inside the other, so they have no common tangents ერთი ტრაექტორია მეორის შიგნითაა, ამიტომ მათ საერთო მხებები არ აქვთ
|
||||
@msg The paths overlap, so they have no internal tangents ტრაექტორიები ერთმანეთს ფარავს, ამიტომ მათ შიდა მხებები არ აქვთ
|
||||
@msg One path lies inside the other, so they have no internal tangents ერთი ტრაექტორია მეორის შიგნითაა, ამიტომ მათ შიდა მხებები არ აქვთ
|
||||
@msg The point lies inside the path, so it has no tangents წერტილი ტრაექტორიის შიგნითაა, ამიტომ მას მხებები არ აქვს
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths ტირეების ტრაექტორიებად გაშლა
|
||||
@msg select paths with dashed strokes to expand აირჩიეთ გასაშლელი ტირეებიანი ხაზის კონტურები
|
||||
@@ -10461,3 +10469,8 @@ font-script Japanese იაპონური
|
||||
@msg A joint does not close by {gap} pt. შეერთება არ იხურება {gap} pt-ით.
|
||||
@msg Two panels pass through each other. ორი პანელი ერთმანეთში გადის.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine"
|
||||
Pressure Sensitive წნევაზე მგრძნობიარე
|
||||
Flex Ribbon მოქნილი ლენტი
|
||||
Pulse Stroke პულსირებადი მონასმი
|
||||
Round Flow მრგვალი ნაკადი
|
||||
Chisel Flow დახრილი ნაკადი
|
||||
|
Can't render this file because it is too large.
|
@@ -1512,6 +1512,7 @@ antiAlias Sharp 날카롭게
|
||||
Delete Brush 브러시 삭제
|
||||
Delete Color 색상 삭제
|
||||
Restore Generated Table 생성된 표 복원
|
||||
Unshift All Colors 모든 색상 이동 취소
|
||||
Delete Character Style 문자 스타일 삭제
|
||||
Delete Empty Artboards 빈 아트보드 삭제
|
||||
Delete Freeform Point 자유 형태 포인트 삭제
|
||||
@@ -3264,6 +3265,8 @@ mark-style Japanese 일본식
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. 스마트 안내선이 스냅하려면 포인터나 드래그한 점이 화면에서 아트에 얼마나 가까이 와야 하는지입니다. 이 거리는 모든 확대/축소에서 같습니다.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 선 세그먼트의 끝이나 중심에서 그린 원을 가까운 곡선에 닿도록 스냅합니다.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 선 세그먼트의 끝을 가까운 직선 세그먼트와 직각으로 만나도록 스냅합니다.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 캔버스에서 각 슬라이스의 번호를 왼쪽 위의 상자에 표시합니다. 끄더라도 슬라이스 윤곽선은 계속 표시됩니다.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 사용자 슬라이스와 개체 슬라이스의 윤곽선 및 번호 상자의 색상입니다. 자동 슬라이스에는 이 색상의 더 흐린 색조가 사용됩니다.
|
||||
Reset all preferences to their defaults? 모든 환경 설정을 기본값으로 재설정하시겠습니까?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 기본값은 환경 설정에서 확인을 클릭하면 적용됩니다. 그곳에서 취소를 누르면 현재 환경 설정이 유지됩니다.
|
||||
Restored documents open unsaved: save them to keep them. 복원된 문서는 저장되지 않은 상태로 열립니다. 보존하려면 저장하세요.
|
||||
@@ -3399,6 +3402,9 @@ mark-style Japanese 일본식
|
||||
No menu item 메뉴 항목 없음
|
||||
Toolbar 도구 모음
|
||||
{toolbar}, in the {tool} group {toolbar}, {tool} 그룹
|
||||
In the menu bar: {path} 메뉴 막대: {path}
|
||||
In the {group} group: press and hold to open it {group} 그룹: 길게 눌러 여세요
|
||||
{home}, not shown now {home}, 지금 표시되지 않음
|
||||
Tool 도구
|
||||
Command 명령
|
||||
@plural {n} result|{n} results 결과 {n}개
|
||||
@@ -5009,6 +5015,7 @@ variable-list-end {0}, {1} {0} 및 {1}
|
||||
@msg paste unavailable 붙여넣을 수 없습니다
|
||||
@msg Save for Web: the image is empty 웹용으로 저장: 이미지가 비어 있습니다
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: 색상 표에 색상이 하나 이상 남아 있어야 합니다
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}`이(가) 다른 키와 같은 색상을 가리킵니다
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}`은(는) "#ff8800" 같은 색상이 아닙니다
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: 색상은 최대 {MAX_TABLE}개입니다
|
||||
@msg no artboard {i} (0-based; the document has {_1}) 아트보드 {i}이(가) 없습니다(0부터 시작, 문서의 아트보드 수: {_1})
|
||||
@@ -7401,6 +7408,7 @@ breakText Glyphs 글리프
|
||||
@msg One path lies inside the other, so they have no common tangents 한 패스가 다른 패스 안에 있어 공통 접선이 없습니다
|
||||
@msg The paths overlap, so they have no internal tangents 패스가 겹쳐 있어 내부 접선이 없습니다
|
||||
@msg One path lies inside the other, so they have no internal tangents 한 패스가 다른 패스 안에 있어 내부 접선이 없습니다
|
||||
@msg The point lies inside the path, so it has no tangents 점이 패스 안에 있어 접선이 없습니다
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths 대시를 패스로 확장
|
||||
@msg select paths with dashed strokes to expand 확장할 점선 획의 패스를 선택하십시오
|
||||
@@ -9711,6 +9719,11 @@ breakText Glyphs 글리프
|
||||
@msg A panel is not joined to the rest by a crease. 패널이 어떤 오시선으로도 나머지와 연결되어 있지 않습니다.
|
||||
@msg A fold line is on a non-printing layer. 접는 선이 인쇄되지 않는 레이어에 있습니다.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 패널: {panels}, 힌지: {hinges}, 오류: {errors}, 경고: {warnings}
|
||||
Pressure Sensitive 압력 감지
|
||||
Flex Ribbon 유연한 리본
|
||||
Pulse Stroke 맥동 획
|
||||
Round Flow 둥근 흐름
|
||||
Chisel Flow 비스듬한 흐름
|
||||
Fold Preview 접기 미리 보기
|
||||
Fold 접기
|
||||
Show Fold Lines 접는 선 표시
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3917,6 +3917,7 @@ theme Appearance Vormgeving
|
||||
Delete Brush Penseel verwijderen
|
||||
Delete Color Kleur verwijderen
|
||||
Restore Generated Table Gegenereerde tabel herstellen
|
||||
Unshift All Colors Verschuiving van alle kleuren ongedaan maken
|
||||
Delete Symbol Symbool verwijderen
|
||||
Delete the selected symbol? Het geselecteerde symbool verwijderen?
|
||||
Delete the selected symbols? De geselecteerde symbolen verwijderen?
|
||||
@@ -4888,6 +4889,9 @@ font-technology Variable Variabel
|
||||
No menu item Geen menu-item
|
||||
Toolbar Gereedschapsbalk
|
||||
{toolbar}, in the {tool} group {toolbar}, in de groep {tool}
|
||||
In the menu bar: {path} In de menubalk: {path}
|
||||
In the {group} group: press and hold to open it In de groep {group}: ingedrukt houden om te openen
|
||||
{home}, not shown now {home}, nu niet zichtbaar
|
||||
@plural {n} result|{n} results {n} resultaat|{n} resultaten
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} van {n} resultaat. Typ verder om ze te beperken.|{shown} van {n} resultaten. Typ verder om ze te beperken.
|
||||
Recent Commands Recente opdrachten
|
||||
@@ -5005,6 +5009,8 @@ font-technology Variable Variabel
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Hoe dicht de aanwijzer of een gesleept punt op het scherm bij een illustratie moet komen voordat slimme hulplijnen erop uitlijnen; de afstand is bij elke zoom gelijk.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Lijnt het einde van een lijnsegment, of een cirkel getekend vanuit het middelpunt, zo uit dat het een curve in de buurt raakt.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Lijnt het einde van een lijnsegment zo uit dat het een recht segment in de buurt onder een rechte hoek raakt.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Toont op het canvas het nummer van elke slice in een vakje linksboven in de slice; staat dit uit, dan blijven de omtrekken van de slices zichtbaar.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. De kleur van de omtrekken van gebruikers- en objectslices en van hun nummervakjes; automatische slices gebruiken een vagere tint ervan.
|
||||
Reset all preferences to their defaults? Alle voorkeuren terugzetten naar de standaardwaarden?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. De standaardwaarden worden toegepast wanneer u in Voorkeuren op OK klikt. Annuleren daar behoudt uw huidige voorkeuren.
|
||||
Smaller ↔ Larger Kleiner ↔ Groter
|
||||
@@ -5452,6 +5458,7 @@ imageTrace Outline Contour
|
||||
@msg choose a location for the package kies een locatie voor het pakket
|
||||
@msg clipboard is empty het klembord is leeg
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: er moet ten minste één kleur in de kleurentabel blijven
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` noemt een kleur die ook een andere sleutel noemt
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` is geen kleur zoals "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: maximaal {MAX_TABLE} kleuren
|
||||
@msg command `{0}` is not available right now: {1} opdracht `{0}` is nu niet beschikbaar: {1}
|
||||
@@ -9694,6 +9701,7 @@ breakText Glyphs Glyphs
|
||||
@msg One path lies inside the other, so they have no common tangents Het ene pad ligt binnen het andere, dus ze hebben geen gemeenschappelijke raaklijnen
|
||||
@msg The paths overlap, so they have no internal tangents De paden overlappen, dus ze hebben geen inwendige raaklijnen
|
||||
@msg One path lies inside the other, so they have no internal tangents Het ene pad ligt binnen het andere, dus ze hebben geen inwendige raaklijnen
|
||||
@msg The point lies inside the path, so it has no tangents Het punt ligt binnen het pad, dus het heeft geen raaklijnen
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Streepjes uitbreiden tot paden
|
||||
@msg select paths with dashed strokes to expand selecteer paden met een streepjeslijn om uit te breiden
|
||||
@@ -10145,6 +10153,11 @@ breakText Glyphs Glyphs
|
||||
@msg A panel is not joined to the rest by a crease. Een paneel is door geen rillijn met de rest verbonden.
|
||||
@msg A fold line is on a non-printing layer. Een vouwlijn staat op een laag die niet wordt afgedrukt.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelen: {panels}, scharnieren: {hinges}, fouten: {errors}, waarschuwingen: {warnings}
|
||||
Pressure Sensitive Drukgevoelig
|
||||
Flex Ribbon Flexibel lint
|
||||
Pulse Stroke Pulserende streek
|
||||
Round Flow Ronde vloei
|
||||
Chisel Flow Schuine vloei
|
||||
Fold Preview Vouwvoorbeeld
|
||||
Fold Vouwen
|
||||
Show Fold Lines Vouwlijnen tonen
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3467,6 +3467,7 @@ theme Appearance Wygląd
|
||||
Delete Brush Usuń pędzel
|
||||
Delete Color Usuń kolor
|
||||
Restore Generated Table Przywróć wygenerowaną tablicę
|
||||
Unshift All Colors Cofnij przesunięcie wszystkich kolorów
|
||||
Delete Symbol Usuń symbol
|
||||
Delete the selected symbol? Usunąć zaznaczony symbol?
|
||||
Delete the selected symbols? Usunąć zaznaczone symbole?
|
||||
@@ -4434,6 +4435,9 @@ font-technology Variable Zmienne
|
||||
No menu item Brak pozycji menu
|
||||
Toolbar Pasek narzędzi
|
||||
{toolbar}, in the {tool} group {toolbar}, w grupie {tool}
|
||||
In the menu bar: {path} Na pasku menu: {path}
|
||||
In the {group} group: press and hold to open it W grupie {group}: naciśnij i przytrzymaj, aby ją otworzyć
|
||||
{home}, not shown now {home}, teraz niewidoczne
|
||||
@plural {n} result|{n} results {n} wynik|{n} wyniki|{n} wyników
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} z {n} wyniku. Pisz dalej, aby je zawęzić.|{shown} z {n} wyników. Pisz dalej, aby je zawęzić.|{shown} z {n} wyników. Pisz dalej, aby je zawęzić.
|
||||
Recent Commands Ostatnie polecenia
|
||||
@@ -4551,6 +4555,8 @@ font-technology Variable Zmienne
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Jak blisko na ekranie wskaźnik lub przeciągany punkt musi znaleźć się przy kompozycji, aby inteligentne linie pomocnicze go przyciągnęły; odległość jest taka sama przy każdym powiększeniu.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Przyciąga koniec odcinka lub okrąg rysowany od środka tak, aby dotykał pobliskiej krzywej.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Przyciąga koniec odcinka tak, aby spotykał pobliski prosty segment pod kątem prostym.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Pokazuje na obszarze roboczym numer każdego plasterka w ramce w jego lewym górnym rogu; po wyłączeniu kontury plasterków nadal są widoczne.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Kolor konturów plasterków użytkownika i obiektów oraz ramek z ich numerami; plasterki automatyczne używają bledszego odcienia tego koloru.
|
||||
Reset all preferences to their defaults? Przywrócić domyślne wartości wszystkich preferencji?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Wartości domyślne zostaną zastosowane po kliknięciu OK w Preferencjach. Anuluj w tym oknie zachowuje bieżące preferencje.
|
||||
Smaller ↔ Larger Mniejszy ↔ większy
|
||||
@@ -5201,6 +5207,7 @@ liquify-list-end {0}, {1} {0} i {1}
|
||||
@msg choose a location for the package wybierz lokalizację pakietu
|
||||
@msg clipboard is empty schowek jest pusty
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: w tablicy kolorów musi zostać co najmniej jeden kolor
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` wskazuje kolor, który wskazuje też inny klucz
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` nie jest kolorem w rodzaju "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: maksymalnie {MAX_TABLE} kolorów
|
||||
@msg command `{0}` is not available right now: {1} polecenie `{0}` jest teraz niedostępne: {1}
|
||||
@@ -7657,6 +7664,7 @@ breakText Glyphs Glify
|
||||
@msg One path lies inside the other, so they have no common tangents Jedna ścieżka leży wewnątrz drugiej, więc nie mają wspólnych stycznych
|
||||
@msg The paths overlap, so they have no internal tangents Ścieżki nachodzą na siebie, więc nie mają stycznych wewnętrznych
|
||||
@msg One path lies inside the other, so they have no internal tangents Jedna ścieżka leży wewnątrz drugiej, więc nie mają stycznych wewnętrznych
|
||||
@msg The point lies inside the path, so it has no tangents Punkt leży wewnątrz ścieżki, więc nie ma stycznych
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Rozszerz kreski na ścieżki
|
||||
@msg select paths with dashed strokes to expand zaznacz ścieżki z przerywanym konturem do rozszerzenia
|
||||
@@ -9968,6 +9976,11 @@ breakText Glyphs Glify
|
||||
@msg A panel is not joined to the rest by a crease. Panel nie jest połączony z resztą żadną linią bigowania.
|
||||
@msg A fold line is on a non-printing layer. Linia zgięcia znajduje się na warstwie niedrukowanej.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panele: {panels}, zawiasy: {hinges}, błędy: {errors}, ostrzeżenia: {warnings}
|
||||
Pressure Sensitive Czułe na nacisk
|
||||
Flex Ribbon Elastyczna wstążka
|
||||
Pulse Stroke Pulsujące pociągnięcie
|
||||
Round Flow Okrągły ślad
|
||||
Chisel Flow Skośny ślad
|
||||
Fold Preview Podgląd złożenia
|
||||
Fold Złożenie
|
||||
Show Fold Lines Pokaż linie zgięcia
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -733,6 +733,7 @@ antiAlias Sharp Nítido
|
||||
Delete Brush Excluir Pincel
|
||||
Delete Color Excluir Cor
|
||||
Restore Generated Table Restaurar Tabela Gerada
|
||||
Unshift All Colors Desfazer Mudança de Todas as Cores
|
||||
Delete Character Style Excluir Estilo de Caractere
|
||||
Delete Empty Artboards Excluir Mesas de Trabalho Vazias
|
||||
Delete Freeform Point Excluir Ponto Livre
|
||||
@@ -2728,6 +2729,8 @@ digits Malayalam Malaiala
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Quão perto na tela o ponteiro ou um ponto arrastado precisa chegar da arte para que as guias inteligentes se ajustem a ela; a distância é a mesma em qualquer zoom.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Ajusta a extremidade de um segmento de linha, ou um círculo desenhado a partir do centro, para que toque uma curva próxima.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta a extremidade de um segmento de linha para que encontre um segmento reto próximo em ângulo reto.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Mostra na tela o número de cada fatia em uma caixa no canto superior esquerdo dela; quando desativado, os contornos das fatias continuam visíveis.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. A cor dos contornos das fatias de usuário e de objeto e das caixas com seus números; as fatias automáticas usam um tom mais apagado dessa cor.
|
||||
Reset all preferences to their defaults? Redefinir todas as preferências para o padrão?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Os padrões são aplicados quando você clica em OK em Preferências. Cancelar ali mantém suas preferências atuais.
|
||||
Restored documents open unsaved: save them to keep them. Os documentos restaurados abrem sem salvar: salve-os para mantê-los.
|
||||
@@ -2927,6 +2930,9 @@ digits Malayalam Malaiala
|
||||
No menu item Nenhum item de menu
|
||||
Toolbar Barra de Ferramentas
|
||||
{toolbar}, in the {tool} group {toolbar}, no grupo {tool}
|
||||
In the menu bar: {path} Na barra de menus: {path}
|
||||
In the {group} group: press and hold to open it No grupo {group}: mantenha pressionado para abri-lo
|
||||
{home}, not shown now {home}, não exibido agora
|
||||
@plural {n} result|{n} results {n} resultado|{n} resultados
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Continue digitando para filtrá-los.|{shown} de {n} resultados. Continue digitando para filtrá-los.
|
||||
Recent Commands Comandos recentes
|
||||
@@ -4348,6 +4354,7 @@ axis Both Ambos
|
||||
@msg choose a location for the package escolha um local para o pacote
|
||||
@msg clipboard is empty a área de transferência está vazia
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: pelo menos uma cor deve permanecer na tabela de cores
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` indica uma cor que outra chave também indica
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` não é uma cor como "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: no máximo {MAX_TABLE} cores
|
||||
@msg command `{0}` is not available right now: {1} o comando `{0}` não está disponível agora: {1}
|
||||
@@ -7821,6 +7828,7 @@ breakText Glyphs Glifos
|
||||
@msg One path lies inside the other, so they have no common tangents Um demarcador está dentro do outro, então eles não têm tangentes comuns
|
||||
@msg The paths overlap, so they have no internal tangents Os demarcadores se sobrepõem, então eles não têm tangentes internas
|
||||
@msg One path lies inside the other, so they have no internal tangents Um demarcador está dentro do outro, então eles não têm tangentes internas
|
||||
@msg The point lies inside the path, so it has no tangents O ponto está dentro do demarcador, então ele não tem tangentes
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Expandir traços em demarcadores
|
||||
@msg select paths with dashed strokes to expand selecione demarcadores com traçado tracejado para expandir
|
||||
@@ -10179,6 +10187,11 @@ swatch Yellow Green Verde-amarelado
|
||||
@msg A panel is not joined to the rest by a crease. Um painel não está unido ao restante por nenhuma linha de vinco.
|
||||
@msg A fold line is on a non-printing layer. Uma linha de dobra está em uma camada não imprimível.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Painéis: {panels}, dobradiças: {hinges}, erros: {errors}, avisos: {warnings}
|
||||
Pressure Sensitive Sensível à pressão
|
||||
Flex Ribbon Fita flexível
|
||||
Pulse Stroke Traço pulsante
|
||||
Round Flow Fluxo redondo
|
||||
Chisel Flow Fluxo chanfrado
|
||||
Fold Preview Visualização da Dobra
|
||||
Fold Dobra
|
||||
Show Fold Lines Mostrar Linhas de Dobra
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -817,6 +817,7 @@ font-technology Variable Вариативные
|
||||
Delete Brush Удалить кисть
|
||||
Delete Color Удалить цвет
|
||||
Restore Generated Table Восстановить созданную таблицу
|
||||
Unshift All Colors Отменить сдвиг всех цветов
|
||||
Delete Character Style Удалить стиль символа
|
||||
Delete Empty Artboards Удалить пустые монтажные области
|
||||
Delete Freeform Point Удалить произвольную точку
|
||||
@@ -3273,6 +3274,8 @@ digits Malayalam Малаялам
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Насколько близко на экране указатель или перетаскиваемая точка должны подойти к объекту, чтобы умные направляющие привязали их; расстояние одинаково при любом масштабе.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Привязывает конец отрезка или окружность, нарисованную от центра, так, чтобы она касалась ближайшей кривой.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Привязывает конец отрезка так, чтобы он встречал ближайший прямой сегмент под прямым углом.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показывает на холсте номер каждого фрагмента в рамке в его левом верхнем углу; если параметр выключен, контуры фрагментов по-прежнему видны.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Цвет контуров пользовательских и объектных фрагментов и рамок с их номерами; автоматические фрагменты используют более бледный оттенок этого цвета.
|
||||
Reset all preferences to their defaults? Сбросить все настройки до значений по умолчанию?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Значения по умолчанию применяются, когда вы нажимаете ОК в окне «Настройки». Отмена там сохраняет текущие настройки.
|
||||
Restore Recovered Documents Восстановить восстановленные документы
|
||||
@@ -3507,6 +3510,9 @@ digits Malayalam Малаялам
|
||||
No menu item Нет пункта меню
|
||||
Toolbar Панель инструментов
|
||||
{toolbar}, in the {tool} group {toolbar}, в группе «{tool}»
|
||||
In the menu bar: {path} В строке меню: {path}
|
||||
In the {group} group: press and hold to open it В группе {group}: нажмите и удерживайте, чтобы открыть её
|
||||
{home}, not shown now {home}, сейчас не показано
|
||||
@plural {n} result|{n} results {n} результат|{n} результата|{n} результатов
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} из {n} результата. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их.
|
||||
Recent Commands Недавние команды
|
||||
@@ -5112,6 +5118,7 @@ liquify-list-end {0}, {1} {0} и {1}
|
||||
@msg choose a location for the package выберите расположение для пакета
|
||||
@msg clipboard is empty буфер обмена пуст
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: в цветовой таблице должен остаться хотя бы один цвет
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` обозначает цвет, который обозначает и другой ключ
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` не является цветом, например "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: не более {MAX_TABLE} цветов
|
||||
@msg command `{0}` is not available right now: {1} команда `{0}` сейчас недоступна: {1}
|
||||
@@ -7792,6 +7799,7 @@ breakText Glyphs Глифы
|
||||
@msg One path lies inside the other, so they have no common tangents Один контур лежит внутри другого, поэтому у них нет общих касательных
|
||||
@msg The paths overlap, so they have no internal tangents Контуры перекрываются, поэтому у них нет внутренних касательных
|
||||
@msg One path lies inside the other, so they have no internal tangents Один контур лежит внутри другого, поэтому у них нет внутренних касательных
|
||||
@msg The point lies inside the path, so it has no tangents Точка лежит внутри контура, поэтому у неё нет касательных
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Разобрать штрихи на контуры
|
||||
@msg select paths with dashed strokes to expand выделите контуры со штриховой обводкой для разбора
|
||||
@@ -10206,3 +10214,8 @@ shape Open Открытый
|
||||
@msg Two panels pass through each other. Две панели проходят друг сквозь друга.
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
Pressure Sensitive Чувствительные к нажиму
|
||||
Flex Ribbon Гибкая лента
|
||||
Pulse Stroke Пульсирующий штрих
|
||||
Round Flow Круглый поток
|
||||
Chisel Flow Косой поток
|
||||
|
Can't render this file because it is too large.
|
@@ -807,6 +807,7 @@ font-technology Variable Variabla
|
||||
Delete Brush Radera pensel
|
||||
Delete Color Radera färg
|
||||
Restore Generated Table Återställ genererad tabell
|
||||
Unshift All Colors Ta bort förskjutning av alla färger
|
||||
Delete Character Style Radera teckenstil
|
||||
Delete Empty Artboards Radera tomma ritytor
|
||||
Delete Freeform Point Radera fri punkt
|
||||
@@ -3167,6 +3168,8 @@ digits Malayalam Malayalam
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Hur nära på skärmen pekaren eller en dragen punkt måste komma teckningen för att de smarta stödlinjerna ska fästa mot den; avståndet är detsamma vid alla zoomnivåer.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Fäster änden av ett linjesegment, eller en cirkel ritad från sin mitt, så att den rör en närliggande kurva.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Fäster änden av ett linjesegment så att det möter ett närliggande rakt segment i rät vinkel.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Visar varje skivas nummer i en ruta i dess övre vänstra hörn på arbetsytan; när det är avstängt visas skivornas konturer fortfarande.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Färgen på konturerna för användar- och objektskivor och på deras nummerrutor; automatiska skivor använder en blekare nyans av den.
|
||||
Reset all preferences to their defaults? Återställa alla inställningar till standard?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Standardvärdena verkställs när du klickar på OK i Inställningar. Avbryt där behåller dina nuvarande inställningar.
|
||||
Restore Recovered Documents Återställ återskapade dokument
|
||||
@@ -3387,6 +3390,9 @@ digits Malayalam Malayalam
|
||||
No menu item Inget menyalternativ
|
||||
Toolbar Verktygsfält
|
||||
{toolbar}, in the {tool} group {toolbar}, i gruppen {tool}
|
||||
In the menu bar: {path} I menyraden: {path}
|
||||
In the {group} group: press and hold to open it I gruppen {group}: tryck och håll ned för att öppna den
|
||||
{home}, not shown now {home}, visas inte nu
|
||||
@plural {n} result|{n} results {n} resultat|{n} resultat
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} av {n} resultat. Fortsätt skriva för att begränsa dem.|{shown} av {n} resultat. Fortsätt skriva för att begränsa dem.
|
||||
Recent Commands Senaste kommandon
|
||||
@@ -4981,6 +4987,7 @@ liquify-list-end {0}, {1} {0} och {1}
|
||||
@msg choose a location for the package välj en plats för paketet
|
||||
@msg clipboard is empty urklippet är tomt
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: minst en färg måste finnas kvar i färgtabellen
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` anger en färg som även en annan nyckel anger
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` är inte en färg som "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: högst {MAX_TABLE} färger
|
||||
@msg command `{0}` is not available right now: {1} kommandot `{0}` är inte tillgängligt just nu: {1}
|
||||
@@ -7836,6 +7843,7 @@ breakText Glyphs Glyfer
|
||||
@msg One path lies inside the other, so they have no common tangents Den ena banan ligger inuti den andra, så de har inga gemensamma tangenter
|
||||
@msg The paths overlap, so they have no internal tangents Banorna överlappar, så de har inga inre tangenter
|
||||
@msg One path lies inside the other, so they have no internal tangents Den ena banan ligger inuti den andra, så de har inga inre tangenter
|
||||
@msg The point lies inside the path, so it has no tangents Punkten ligger inuti banan, så den har inga tangenter
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Expandera streck till banor
|
||||
@msg select paths with dashed strokes to expand markera banor med streckad kontur att expandera
|
||||
@@ -9808,3 +9816,8 @@ digits Hindi Hindi
|
||||
@msg A joint does not close by {gap} pt. En fog sluter inte med {gap} pt.
|
||||
@msg Two panels pass through each other. Två paneler går igenom varandra.
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen
|
||||
Pressure Sensitive Tryckkänslig
|
||||
Flex Ribbon Flexibelt band
|
||||
Pulse Stroke Pulserande drag
|
||||
Round Flow Runt flöde
|
||||
Chisel Flow Snedflöde
|
||||
|
Can't render this file because it is too large.
|
@@ -595,8 +595,9 @@ fn built_in_library_brush_names_are_in_complete_catalogs() {
|
||||
.flat_map(|(_, lib)| lib.brushes.iter().map(|b| b.name.clone()).collect::<Vec<_>>())
|
||||
.collect();
|
||||
names.sort();
|
||||
let duplicates: Vec<&str> = names.windows(2).filter(|pair| pair[0] == pair[1]).map(|pair| pair[0].as_str()).collect();
|
||||
assert_eq!(duplicates, ["Zigzag"], "only the established Pattern Borders / Game Trails name is shared");
|
||||
names.dedup();
|
||||
assert_eq!(names.len(), 46, "{names:?}");
|
||||
let mut bad = vec![];
|
||||
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
|
||||
let missing: Vec<&String> = names.iter().filter(|n| lang.catalog().plain(n).is_none()).collect();
|
||||
|
||||
@@ -798,6 +798,7 @@ font-technology Variable Değişken
|
||||
Delete Brush Fırçayı Sil
|
||||
Delete Color Rengi Sil
|
||||
Restore Generated Table Oluşturulan Tabloyu Geri Yükle
|
||||
Unshift All Colors Tüm Renklerin Kaydırmasını Kaldır
|
||||
Delete Character Style Karakter Stilini Sil
|
||||
Delete Empty Artboards Boş Çalışma Yüzeylerini Sil
|
||||
Delete Freeform Point Serbest Biçim Noktasını Sil
|
||||
@@ -3010,6 +3011,8 @@ digits Malayalam Malayalam
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Akıllı Kılavuzların yaslaması için işaretçinin veya sürüklenen noktanın ekranda çizime ne kadar yaklaşması gerektiği; mesafe her yakınlaştırmada aynıdır.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Bir çizgi parçasının ucunu veya merkezinden çizilen bir daireyi yakındaki bir eğriye değecek şekilde yaslar.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Bir çizgi parçasının ucunu yakındaki düz bir parçayla dik açıyla buluşacak şekilde yaslar.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Tuvalde her dilimin numarasını sol üst köşesindeki bir kutuda gösterir; kapalıyken dilimlerin dış çizgileri görünmeye devam eder.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Kullanıcı ve nesne dilimlerinin dış çizgilerinin ve numara kutularının rengi; otomatik dilimler bu rengin daha soluk bir tonunu kullanır.
|
||||
Reset all preferences to their defaults? Tüm tercihler varsayılanlarına sıfırlansın mı?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Varsayılanlar, Tercihler'de Tamam'a tıkladığınızda uygulanır. Oradaki İptal, mevcut tercihlerinizi korur.
|
||||
Restore Recovered Documents Kurtarılan Belgeleri Geri Yükle
|
||||
@@ -3265,6 +3268,9 @@ digits Malayalam Malayalam
|
||||
No menu item Menü öğesi yok
|
||||
Toolbar Araç Çubuğu
|
||||
{toolbar}, in the {tool} group {toolbar}, {tool} grubunda
|
||||
In the menu bar: {path} Menü çubuğunda: {path}
|
||||
In the {group} group: press and hold to open it {group} grubunda: açmak için basılı tutun
|
||||
{home}, not shown now {home}, şu anda gösterilmiyor
|
||||
@plural {n} result|{n} results {n} sonuç
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} sonuçtan {shown} tanesi. Daraltmak için yazmaya devam edin.
|
||||
Recent Commands Son komutlar
|
||||
@@ -4798,6 +4804,7 @@ liquify-list-end {0}, {1} {0} ve {1}
|
||||
@msg choose a location for the package paket için bir yer seçin
|
||||
@msg clipboard is empty pano boş
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: renk tablosunda en az bir renk kalmalı
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` başka bir anahtarın da belirttiği bir rengi belirtiyor
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}`, "#ff8800" gibi bir renk değil
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: en fazla {MAX_TABLE} renginde
|
||||
@msg command `{0}` is not available right now: {1} `{0}` komutu şu anda kullanılamıyor: {1}
|
||||
@@ -9692,6 +9699,7 @@ breakText Glyphs Glifler
|
||||
@msg One path lies inside the other, so they have no common tangents Bir yol diğerinin içinde, bu yüzden ortak teğetleri yok
|
||||
@msg The paths overlap, so they have no internal tangents Yollar örtüşüyor, bu yüzden iç teğetleri yok
|
||||
@msg One path lies inside the other, so they have no internal tangents Bir yol diğerinin içinde, bu yüzden iç teğetleri yok
|
||||
@msg The point lies inside the path, so it has no tangents Nokta yolun içinde, bu yüzden teğeti yok
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Tireleri Yollara Genişlet
|
||||
@msg select paths with dashed strokes to expand genişletilecek kesikli konturlu yolları seçin
|
||||
@@ -10066,6 +10074,11 @@ breakText Glyphs Glifler
|
||||
@msg A panel is not joined to the rest by a crease. Bir panel geri kalanlara hiçbir pilyaj çizgisiyle bağlı değil.
|
||||
@msg A fold line is on a non-printing layer. Bir katlama çizgisi yazdırılmayan bir katmanda.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneller: {panels}, menteşeler: {hinges}, hatalar: {errors}, uyarılar: {warnings}
|
||||
Pressure Sensitive Basınca Duyarlı
|
||||
Flex Ribbon Esnek Şerit
|
||||
Pulse Stroke Atımlı Çizgi
|
||||
Round Flow Yuvarlak Akış
|
||||
Chisel Flow Eğimli Akış
|
||||
Fold Preview Katlama Önizlemesi
|
||||
Fold Katlama
|
||||
Show Fold Lines Katlama Çizgilerini Göster
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -815,6 +815,7 @@ font-technology Variable Варіативні
|
||||
Delete Brush Видалити пензель
|
||||
Delete Color Видалити колір
|
||||
Restore Generated Table Відновити створену таблицю
|
||||
Unshift All Colors Скасувати зсув усіх кольорів
|
||||
Delete Character Style Видалити стиль символу
|
||||
Delete Empty Artboards Видалити порожні монтажні області
|
||||
Delete Freeform Point Видалити довільну точку
|
||||
@@ -3283,6 +3284,8 @@ digits Malayalam Малаялам
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Наскільки близько на екрані вказівник або перетягувана точка мають підійти до об’єкта, щоб розумні напрямні їх прив’язали; відстань однакова за будь-якого масштабу.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Прив’язує кінець відрізка або коло, намальоване від центру, так, щоб воно торкалося найближчої кривої.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Прив’язує кінець відрізка так, щоб він зустрічав найближчий прямий сегмент під прямим кутом.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показує на полотні номер кожного фрагмента в рамці в його лівому верхньому куті; коли параметр вимкнено, контури фрагментів і далі видно.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Колір контурів користувацьких і об’єктних фрагментів та рамок з їхніми номерами; автоматичні фрагменти використовують блідіший відтінок цього кольору.
|
||||
Reset all preferences to their defaults? Скинути всі налаштування до значень за промовчанням?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Значення за промовчанням застосовуються, коли ви натискаєте ОК у вікні «Налаштування». Скасувати там зберігає поточні налаштування.
|
||||
Restore Recovered Documents Відновити відновлені документи
|
||||
@@ -3517,6 +3520,9 @@ digits Malayalam Малаялам
|
||||
No menu item Немає пункту меню
|
||||
Toolbar Панель інструментів
|
||||
{toolbar}, in the {tool} group {toolbar}, у групі «{tool}»
|
||||
In the menu bar: {path} У рядку меню: {path}
|
||||
In the {group} group: press and hold to open it У групі {group}: натисніть і утримуйте, щоб відкрити її
|
||||
{home}, not shown now {home}, зараз не показано
|
||||
Tool Інструмент
|
||||
Command Команда
|
||||
@plural {n} result|{n} results {n} результат|{n} результати|{n} результатів
|
||||
@@ -5101,6 +5107,7 @@ liquify-list-end {0}, {1} {0} і {1}
|
||||
@msg choose a location for the package виберіть розташування для пакета
|
||||
@msg clipboard is empty буфер обміну порожній
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: у колірній таблиці має залишитися принаймні один колір
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` позначає колір, який позначає й інший ключ
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` не є кольором, наприклад "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: не більше {MAX_TABLE} кольорів
|
||||
@msg command `{0}` is not available right now: {1} команда `{0}` зараз недоступна: {1}
|
||||
@@ -7411,6 +7418,7 @@ breakText Glyphs Гліфи
|
||||
@msg One path lies inside the other, so they have no common tangents Один контур лежить усередині іншого, тому вони не мають спільних дотичних
|
||||
@msg The paths overlap, so they have no internal tangents Контури перекриваються, тому вони не мають внутрішніх дотичних
|
||||
@msg One path lies inside the other, so they have no internal tangents Один контур лежить усередині іншого, тому вони не мають внутрішніх дотичних
|
||||
@msg The point lies inside the path, so it has no tangents Точка лежить усередині контуру, тому вона не має дотичних
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Розібрати штрихи на контури
|
||||
@msg select paths with dashed strokes to expand виділіть контури зі штриховим обведенням для розбору
|
||||
@@ -9723,6 +9731,11 @@ breakText Glyphs Гліфи
|
||||
@msg A panel is not joined to the rest by a crease. Панель не з’єднана з рештою жодною лінією біговки.
|
||||
@msg A fold line is on a non-printing layer. Лінія згину лежить на шарі, що не друкується.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панелі: {panels}, шарніри: {hinges}, помилки: {errors}, попередження: {warnings}
|
||||
Pressure Sensitive Чутливі до натиску
|
||||
Flex Ribbon Гнучка стрічка
|
||||
Pulse Stroke Пульсуючий штрих
|
||||
Round Flow Круглий потік
|
||||
Chisel Flow Косий потік
|
||||
Fold Preview Перегляд згину
|
||||
Fold Згин
|
||||
Show Fold Lines Показати лінії згину
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -945,6 +945,7 @@ font-technology Variable Biến thiên
|
||||
Delete Brush Xóa cọ
|
||||
Delete Color Xóa màu
|
||||
Restore Generated Table Khôi phục bảng đã tạo
|
||||
Unshift All Colors Bỏ dịch chuyển tất cả màu
|
||||
Delete Character Style Xóa kiểu ký tự
|
||||
Delete Data Set Xóa tập dữ liệu
|
||||
Delete Design Xóa thiết kế
|
||||
@@ -3599,6 +3600,8 @@ mark-style Japanese Kiểu Nhật
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Con trỏ hoặc điểm đang kéo phải đến gần hình vẽ trên màn hình bao nhiêu để đường căn thông minh hút vào; khoảng cách này như nhau ở mọi mức thu phóng.
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Hút đầu mút của đoạn thẳng, hoặc hình tròn vẽ từ tâm, để nó chạm vào một đường cong ở gần.
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Hút đầu mút của đoạn thẳng để nó gặp một đoạn thẳng ở gần theo góc vuông.
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Hiển thị trên khung vẽ số của mỗi lát cắt trong một ô ở góc trên bên trái của nó; khi tắt, đường viền của các lát cắt vẫn hiện.
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Màu của đường viền lát cắt người dùng và lát cắt đối tượng cùng các ô số của chúng; lát cắt tự động dùng một sắc độ nhạt hơn của màu này.
|
||||
Reset all preferences to their defaults? Đặt lại tất cả tùy chọn về mặc định?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Giá trị mặc định được áp dụng khi bạn nhấn OK trong Tùy chọn. Hủy ở đó giữ nguyên các tùy chọn hiện tại của bạn.
|
||||
Restore Recovered Documents Khôi phục tài liệu đã phục hồi
|
||||
@@ -3863,6 +3866,9 @@ mark-style Japanese Kiểu Nhật
|
||||
No menu item Không có mục menu
|
||||
Toolbar Thanh công cụ
|
||||
{toolbar}, in the {tool} group {toolbar}, trong nhóm {tool}
|
||||
In the menu bar: {path} Trên thanh menu: {path}
|
||||
In the {group} group: press and hold to open it Trong nhóm {group}: nhấn giữ để mở
|
||||
{home}, not shown now {home}, hiện không hiển thị
|
||||
Tool Công cụ
|
||||
Command Lệnh
|
||||
@plural {n} result|{n} results {n} kết quả
|
||||
@@ -5122,6 +5128,7 @@ theme Appearance Giao diện
|
||||
@msg clipboard is empty khay nhớ tạm trống
|
||||
@msg closing needs three anchors đóng đường dẫn cần ba điểm neo
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted: phải giữ lại ít nhất một màu trong bảng màu
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted: `{k}` chỉ một màu mà khóa khác cũng chỉ
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` không phải là màu như "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: tối đa {MAX_TABLE} màu
|
||||
@msg column must be true or a number from 1 column phải là true hoặc số từ 1
|
||||
@@ -7455,6 +7462,7 @@ breakText Glyphs Glyph
|
||||
@msg One path lies inside the other, so they have no common tangents Một đường dẫn nằm bên trong đường dẫn kia, nên chúng không có tiếp tuyến chung
|
||||
@msg The paths overlap, so they have no internal tangents Các đường dẫn chồng lên nhau, nên chúng không có tiếp tuyến trong
|
||||
@msg One path lies inside the other, so they have no internal tangents Một đường dẫn nằm bên trong đường dẫn kia, nên chúng không có tiếp tuyến trong
|
||||
@msg The point lies inside the path, so it has no tangents Điểm nằm bên trong đường dẫn, nên nó không có tiếp tuyến
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths Mở rộng nét đứt thành đường dẫn
|
||||
@msg select paths with dashed strokes to expand chọn các đường dẫn có nét đứt để mở rộng
|
||||
@@ -7962,4 +7970,9 @@ breakText Glyphs Glyph
|
||||
@msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine"
|
||||
Pressure Sensitive Nhạy áp lực
|
||||
Flex Ribbon Dải mềm
|
||||
Pulse Stroke Nét rung
|
||||
Round Flow Nét tròn
|
||||
Chisel Flow Nét vát
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: hãy dùng "{_1}" hoặc "{_2}"
|
||||
|
Can't render this file because it is too large.
|
@@ -763,6 +763,7 @@ antiAlias Sharp 锐利
|
||||
Delete Brush 删除画笔
|
||||
Delete Color 删除颜色
|
||||
Restore Generated Table 恢复生成的颜色表
|
||||
Unshift All Colors 取消偏移所有颜色
|
||||
Delete Character Style 删除字符样式
|
||||
Delete Empty Artboards 删除空白画板
|
||||
Delete Freeform Point 删除自由点
|
||||
@@ -3140,6 +3141,8 @@ digits Malayalam 马拉雅拉姆数字
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. 指针或拖动的点在屏幕上需离图稿多近,智能参考线才会吸附;该距离在任何缩放比例下都相同。
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 吸附线段的端点或从中心绘制的圆,使其与附近的曲线相切。
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 吸附线段的端点,使其与附近的直线段成直角相交。
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 在画布上于每个切片左上角的方框中显示其编号;关闭时,切片轮廓仍会显示。
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 用户切片和对象切片的轮廓及其编号方框的颜色;自动切片使用此颜色较淡的色调。
|
||||
Reset all preferences to their defaults? 将所有首选项重置为默认值?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 在首选项中点击确定后才会应用默认值。在那里点击取消会保留当前首选项。
|
||||
Restore Recovered Documents 恢复已恢复的文档
|
||||
@@ -3342,6 +3345,9 @@ digits Malayalam 马拉雅拉姆数字
|
||||
No menu item 无菜单项
|
||||
Toolbar 工具栏
|
||||
{toolbar}, in the {tool} group {toolbar},位于 {tool} 组中
|
||||
In the menu bar: {path} 在菜单栏中:{path}
|
||||
In the {group} group: press and hold to open it 在“{group}”组中:按住即可打开
|
||||
{home}, not shown now {home},当前未显示
|
||||
@plural {n} result|{n} results {n} 个结果
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 共 {n} 个结果,显示 {shown} 个。继续输入以缩小范围。
|
||||
Recent Commands 最近使用的命令
|
||||
@@ -4769,6 +4775,7 @@ imageTrace Outline 轮廓
|
||||
@msg paste unavailable 无法粘贴
|
||||
@msg Save for Web: the image is empty 存储为 Web 所用格式:图像为空
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted:颜色表中至少要保留一种颜色
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted:`{k}` 与另一个键指的是同一种颜色
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}:`{h}` 不是颜色,例如 "#ff8800"
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}:最多 {MAX_TABLE} 种颜色
|
||||
@msg no artboard {i} (0-based; the document has {_1}) 没有画板 {i} (从 0 开始计数;文档有 {_1} 个)
|
||||
@@ -7639,6 +7646,7 @@ breakText Glyphs 字形
|
||||
@msg One path lies inside the other, so they have no common tangents 一条路径位于另一条之内,因此它们没有公切线
|
||||
@msg The paths overlap, so they have no internal tangents 路径相互重叠,因此它们没有内公切线
|
||||
@msg One path lies inside the other, so they have no internal tangents 一条路径位于另一条之内,因此它们没有内公切线
|
||||
@msg The point lies inside the path, so it has no tangents 该点位于路径之内,因此没有切线
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths 将短划线扩展为路径
|
||||
@msg select paths with dashed strokes to expand 请选择要扩展的虚线描边路径
|
||||
@@ -9961,3 +9969,8 @@ breakText Glyphs 字形
|
||||
@msg A joint does not close by {gap} pt. 有一处接缝相差 {gap} pt 未闭合。
|
||||
@msg Two panels pass through each other. 两个面板相互穿插。
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率
|
||||
Pressure Sensitive 压感画笔
|
||||
Flex Ribbon 柔韧色带
|
||||
Pulse Stroke 脉动笔触
|
||||
Round Flow 圆头流线
|
||||
Chisel Flow 斜头流线
|
||||
|
Can't render this file because it is too large.
|
@@ -783,6 +783,7 @@ font-technology Variable 可變
|
||||
Delete Brush 刪除筆刷
|
||||
Delete Color 刪除顏色
|
||||
Restore Generated Table 還原產生的色彩表
|
||||
Unshift All Colors 取消位移所有顏色
|
||||
Delete Character Style 刪除字元樣式
|
||||
Delete Empty Artboards 刪除空白工作區域
|
||||
Delete Freeform Point 刪除任意形狀錨點
|
||||
@@ -2235,6 +2236,7 @@ file-filter Templates 範本
|
||||
@msg paste unavailable 無法貼上
|
||||
@msg Save for Web: the image is empty 儲存為網頁用:影像是空的
|
||||
@msg colorTable.deleted: at least one color has to stay in the color table colorTable.deleted:色彩表中至少要保留一種顏色
|
||||
@msg colorTable.shifted: `{k}` names a color another key names colorTable.shifted:`{k}` 與另一個鍵指的是同一種顏色
|
||||
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}:`{h}` 不是像 "#ff8800" 這樣的顏色
|
||||
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}:最多 {MAX_TABLE} 種顏色
|
||||
@msg no artboard {i} (0-based; the document has {_1}) 沒有工作區域 {i} (從 0 起算;文件有 {_1} 個)
|
||||
@@ -4488,6 +4490,8 @@ digits Malayalam 馬來亞拉姆數字
|
||||
How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. 指標或拖曳的點在螢幕上需離圖稿多近,智慧型參考線才會靠齊;此距離在任何縮放比例下都相同。
|
||||
Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 靠齊線段的端點或從中心繪製的圓,使其與附近的曲線相切。
|
||||
Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 靠齊線段的端點,使其與附近的直線段成直角相交。
|
||||
Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 在畫布上於每個切片左上角的方框中顯示其編號;關閉時,切片輪廓仍會顯示。
|
||||
The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 使用者切片和物件切片的輪廓及其編號方框的顏色;自動切片使用此顏色較淡的色調。
|
||||
Reset all preferences to their defaults? 要將所有偏好設定重設為預設值嗎?
|
||||
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 在偏好設定中按下確定後才會套用預設值。在那裡按下取消會保留目前的偏好設定。
|
||||
Restore Recovered Documents 還原找回的文件
|
||||
@@ -4720,6 +4724,9 @@ digits Malayalam 馬來亞拉姆數字
|
||||
No menu item 無選單項目
|
||||
Toolbar 工具列
|
||||
{toolbar}, in the {tool} group {toolbar},位於 {tool} 群組中
|
||||
In the menu bar: {path} 在選單列中:{path}
|
||||
In the {group} group: press and hold to open it 在「{group}」群組中:按住即可開啟
|
||||
{home}, not shown now {home},目前未顯示
|
||||
Tool 工具
|
||||
Command 指令
|
||||
@plural {n} result|{n} results {n} 個結果
|
||||
@@ -7460,6 +7467,7 @@ breakText Glyphs 字符
|
||||
@msg One path lies inside the other, so they have no common tangents 一條路徑位於另一條之內,因此它們沒有公切線
|
||||
@msg The paths overlap, so they have no internal tangents 路徑互相重疊,因此它們沒有內公切線
|
||||
@msg One path lies inside the other, so they have no internal tangents 一條路徑位於另一條之內,因此它們沒有內公切線
|
||||
@msg The point lies inside the path, so it has no tangents 該點位於路徑之內,因此沒有切線
|
||||
# Path Precision Tools add-on: Expand Dashes into Paths.
|
||||
Expand Dashes into Paths 將短破折號展開為路徑
|
||||
@msg select paths with dashed strokes to expand 請選取要展開的虛線筆畫路徑
|
||||
@@ -9775,3 +9783,8 @@ breakText Glyphs 字符
|
||||
@msg A joint does not close by {gap} pt. 有一處接縫相差 {gap} pt 未閉合。
|
||||
@msg Two panels pass through each other. 兩個面板相互穿插。
|
||||
@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小
|
||||
Pressure Sensitive 壓感筆刷
|
||||
Flex Ribbon 柔韌色帶
|
||||
Pulse Stroke 脈動筆觸
|
||||
Round Flow 圓頭流線
|
||||
Chisel Flow 斜頭流線
|
||||
|
Can't render this file because it is too large.
|
@@ -37,6 +37,7 @@ pub fn menu_bar(app: &mut VectorcraftApp, ui: &mut egui::Ui) -> f32 {
|
||||
for (title, items) in tree.iter() {
|
||||
let text = egui::RichText::new(tl!(title)).size(13.0).color(t.text);
|
||||
let resp = ui.add(egui::Button::new(text));
|
||||
crate::palette::note_spot(ui, resp.rect, || crate::palette::SpotAt::Menu((*title).to_string()));
|
||||
egui::Popup::menu(&resp).show(|ui| menu_body(app, ui, items, &mut clicked));
|
||||
if *title == "File" {
|
||||
file_open = egui::Popup::is_id_open(ui.ctx(), egui::Popup::default_response_id(&resp));
|
||||
|
||||
@@ -707,6 +707,7 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec<Item>)> {
|
||||
panel("Pathfinder", "pathfinder"),
|
||||
panel("Pattern Options", "patternOptions"),
|
||||
panel("Properties", "properties"),
|
||||
panel("Production Preflight", crate::panels::preflight::ID),
|
||||
panel("Script Console", crate::panels::script_console::ID),
|
||||
panel("Separations Preview", "separations"),
|
||||
panel("Stroke", "stroke"),
|
||||
|
||||
@@ -689,7 +689,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"window.panel.float",
|
||||
"Float Panel",
|
||||
"",
|
||||
"{panel: id or \"tools\", x?, y?, width?, height?, group?: bool, column?: bool or n, onto?: id, above?: id, below?: id, collapsed?: bool} float a panel (with `group`, its whole group; with `column`, its whole dock column or floating window) as a floating window with its top-left corner at x, y in window points (default: inside the dock area, cascaded), as dragging its tab out does; a whole floating window keeps its rect unless given one. `onto` makes it a tab of the floating group holding that panel instead; `above` / `below` a group of its own above or below the group holding that panel, in its floating window or dock column. `collapsed` then minimizes (true) or restores (false) its window or group. A hidden panel shows first. \"tools\" floats the Tools panel at x, y. Returns {layout, closed, floating}",
|
||||
"{panel: id or \"tools\", x?, y?, width?, height?, group?: bool, column?: bool or n, onto?: id, above?: id, below?: id, collapsed?: bool} float a panel (with `group`, its whole group; with `column`, its whole dock column or floating window) as a floating window with its top-left corner at x, y in window points (default: inside the dock area, cascaded), as dragging its tab out does; a whole floating window keeps its rect unless given one. Supplied geometry also moves or resizes an existing native window; omitted components keep their current values. `onto` makes it a tab of the floating group holding that panel instead; `above` / `below` a group of its own above or below the group holding that panel, in its floating window or dock column. `collapsed` then minimizes (true) or restores (false) its window or group. A hidden panel shows first. \"tools\" floats the Tools panel at x, y. Returns {layout, closed, floating}",
|
||||
),
|
||||
(
|
||||
"window.panel.dock",
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user