|
|
|
@@ -48,7 +48,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Add New Fill",
|
|
|
|
|
["Window", "Appearance"],
|
|
|
|
|
Some("Cmd+/"),
|
|
|
|
|
"{ids?|id?, target?: \"object\"|\"contents\"} add a fill on top of each selected object's own stack, on an image right below its Contents row, with its top fill's paint (type without one: its characters' fill; else the default fill). With a fill row active (appearance.setActiveItem), no `ids`, no `id` and no `target: \"contents\"`, the new fill takes that row's paint, goes right above it, and becomes the active row; appearance.duplicateItem copies a whole row. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind",
|
|
|
|
|
"{ids?|id?, target?: \"object\"|\"contents\"} add a fill on top of each selected object's own stack, on an image right below its Contents row, with its top fill's paint (type without one: its characters' fill; else the default fill). With a fill row active (appearance.setActiveItem), no `ids`, no `id` and no `target: \"contents\"`, the new fill takes that row's paint, goes right above it, and becomes the active row; appearance.duplicateItem copies a whole row. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes)",
|
|
|
|
|
has_doc,
|
|
|
|
|
|s, p| add_item(s, p, true)
|
|
|
|
|
),
|
|
|
|
@@ -57,7 +57,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Add New Stroke",
|
|
|
|
|
["Window", "Appearance"],
|
|
|
|
|
Some("Cmd+Alt+/"),
|
|
|
|
|
"{ids?|id?, target?} add a stroke on top of each selected object's own stack, on an image right below its Contents row, with its top stroke's paint (else the default stroke) and that stroke's weight when it has paint, at least 1 pt. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind",
|
|
|
|
|
"{ids?|id?, target?} add a stroke on top of each selected object's own stack, on an image right below its Contents row, with its top stroke's paint (else the default stroke) and that stroke's weight when it has paint, at least 1 pt. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes)",
|
|
|
|
|
has_doc,
|
|
|
|
|
|s, p| add_item(s, p, false)
|
|
|
|
|
),
|
|
|
|
@@ -75,7 +75,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Reduce to Basic Appearance",
|
|
|
|
|
["Window", "Appearance"],
|
|
|
|
|
None,
|
|
|
|
|
"{ids?|id?, target?} keep only one visible fill and stroke (without ids: the Appearance panel's active row in place of the topmost one of its kind; else the topmost), without their own opacity, blend mode or effects (a group keeps no rows it lacked), and drop the object's effects. On a path directly in a graph series (a series group's id stands for those paths and the group), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind",
|
|
|
|
|
"{ids?|id?, target?} keep only one visible fill and stroke (without ids: the Appearance panel's active row in place of the topmost one of its kind; else the topmost), without their own opacity, blend mode or effects (a group keeps no rows it lacked), and drop the object's effects. On a path directly in a graph series (a series group's id stands for those paths and the group), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes)",
|
|
|
|
|
has_doc,
|
|
|
|
|
reduce_basic
|
|
|
|
|
),
|
|
|
|
@@ -84,7 +84,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Appearance Item",
|
|
|
|
|
[],
|
|
|
|
|
None,
|
|
|
|
|
"{index: paint-order item index, ids?|id? (default: the selection), target?: \"object\"|\"contents\", opacity?: 0..100, blend?: name, visible?: bool, weight?: pt (strokes), color?|none?|swatch?|gradient? (as paint.setFill), tint?: 0..100, keepModel?: bool (both as paint.setFill), aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection)} edit one fill/stroke of each target object's own appearance stack. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind",
|
|
|
|
|
"{index: paint-order item index, ids?|id? (default: the selection), target?: \"object\"|\"contents\", opacity?: 0..100, blend?: name, visible?: bool, weight?: pt (strokes), color?|none?|swatch?|gradient? (as paint.setFill), tint?: 0..100, keepModel?: bool (both as paint.setFill), aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection)} edit one fill/stroke of each target object's own appearance stack. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes)",
|
|
|
|
|
has_doc,
|
|
|
|
|
set_item
|
|
|
|
|
),
|
|
|
|
@@ -93,7 +93,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Remove Item",
|
|
|
|
|
[],
|
|
|
|
|
None,
|
|
|
|
|
"{index | indices: [..] (paint-order item indices), ids?|id?, target?, aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection)} remove those fills/strokes from each target object's own stack. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind",
|
|
|
|
|
"{index | indices: [..] (paint-order item indices), ids?|id?, target?, aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection)} remove those fills/strokes from each target object's own stack. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes)",
|
|
|
|
|
has_doc,
|
|
|
|
|
remove_item
|
|
|
|
|
),
|
|
|
|
@@ -111,7 +111,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Duplicate Item",
|
|
|
|
|
["Window", "Appearance"],
|
|
|
|
|
None,
|
|
|
|
|
"{index | indices: [..] (paint-order item indices), to?: paint-order index of the copy (with several, of the lowest copy: they land together in their order; default: each right above its item; not with aligned rows of a mixed selection), contents?: count (with `to`: how many items paint below the Contents (Characters) row afterwards; default: it stays between the same items), ids?|id?, target?, aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection)} copy fills/strokes with their effects, as Alt-dragging rows places them. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind",
|
|
|
|
|
"{index | indices: [..] (paint-order item indices), to?: paint-order index of the copy (with several, of the lowest copy: they land together in their order; default: each right above its item; not with aligned rows of a mixed selection), contents?: count (with `to`: how many items paint below the Contents (Characters) row afterwards; default: it stays between the same items), ids?|id?, target?, aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection)} copy fills/strokes with their effects, as Alt-dragging rows places them. On a path directly in a graph series (a series group's id stands for those paths), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes)",
|
|
|
|
|
has_doc,
|
|
|
|
|
duplicate_item
|
|
|
|
|
),
|
|
|
|
@@ -120,7 +120,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Reorder Appearance Item",
|
|
|
|
|
[],
|
|
|
|
|
None,
|
|
|
|
|
"{from: paint-order item index | \"contents\", indices?: [..] (several items instead of from: they move as one block in their order, the lowest landing at `to`; a block landing next to the Contents row keeps its lowest item's side), to, contents?: count, ids?|id?, target?, aligned?: bool (refused when the targets' appearances differ)} move fill/stroke `from` to paint-order index `to`; on a group, layer or type the Contents (Characters) row stays between the same items (a moved item landing next to it keeps its side) unless `contents` says how many items paint below it afterwards. from \"contents\": move that row so `to` items paint below the members (characters) and the rest above. On a path directly in a graph series (a series group's id stands for those paths, except with from \"contents\", which moves the group's own row), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind → {index: where the item landed | contents: the row's slot}",
|
|
|
|
|
"{from: paint-order item index | \"contents\", indices?: [..] (several items instead of from: they move as one block in their order, the lowest landing at `to`; a block landing next to the Contents row keeps its lowest item's side), to, contents?: count, ids?|id?, target?, aligned?: bool (refused when the targets' appearances differ)} move fill/stroke `from` to paint-order index `to`; on a group, layer or type the Contents (Characters) row stays between the same items (a moved item landing next to it keeps its side) unless `contents` says how many items paint below it afterwards. from \"contents\": move that row so `to` items paint below the members (characters) and the rest above. On a path directly in a graph series (a series group's id stands for those paths, except with from \"contents\", which moves the group's own row), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes) → {index: where the item landed | contents: the row's slot}",
|
|
|
|
|
has_doc,
|
|
|
|
|
move_item
|
|
|
|
|
),
|
|
|
|
@@ -129,7 +129,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Eyedropper",
|
|
|
|
|
[],
|
|
|
|
|
None,
|
|
|
|
|
"{source: id, ids?, pickUp?, apply? (trees as eyedropper.setOptions, merged over the Eyedropper Options for this call), reverse?: bool, append?: bool, defaultsOnly?: bool} copy the attributes both picked up and applied (by default the whole appearance stack, opacity and blend mode, and from type to type the character and paragraph attributes using effective character dimensions while preserving target transforms) from `source` to ids (default: highlighted characters while editing type, after Select All in a frame of threaded text the text of the story's frames, leaving out `source`, otherwise the object selection; highlighted characters reject enabled non-neutral object transparency), the fill, stroke and weight also to the paint defaults; `defaultsOnly` updates only paint defaults and cannot be combined with ids, reverse or append; `reverse` (Alt-click) copies from the first selected object (or ids) onto `source` instead, or with nothing selected what the Eyedropper picked up last (a click without Alt); `append` (Shift+Alt-click) adds the source's fills, strokes and effects on top of each target's stack; placed gradients land at the same place relative to each target's bounds (defaults: fitted to new art); with an object of a dynamic symbol instance selected by Direct Selection and no ids, reverse, append or defaultsOnly, that object takes the source's fill and stroke (solid, none, gradient or pattern) for this instance only, as the Eyedropper Options allow, and a source that is not a path, compound path or type, or options that pick up neither color, are refused. On a path directly in a graph series, the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke and the object's opacity and blend mode (exceptions: docs/mcp.md); on a graph label, the graph stores, for every label of its kind, the character attributes the pick gives all of its text, its object opacity and blend mode, and with `append` its topmost visible fill and stroke rows; on a graph's axis line, tick mark or radar ring, its topmost visible fill and stroke rows and object opacity and blend mode for every line of its kind → {ids}",
|
|
|
|
|
"{source: id, ids?, pickUp?, apply? (trees as eyedropper.setOptions, merged over the Eyedropper Options for this call), reverse?: bool, append?: bool, defaultsOnly?: bool} copy the attributes both picked up and applied (by default the whole appearance stack, opacity and blend mode, and from type to type the character and paragraph attributes using effective character dimensions while preserving target transforms) from `source` to ids (default: highlighted characters while editing type, after Select All in a frame of threaded text the text of the story's frames, leaving out `source`, otherwise the object selection; highlighted characters reject enabled non-neutral object transparency), the fill, stroke and weight also to the paint defaults; `defaultsOnly` updates only paint defaults and cannot be combined with ids, reverse or append; `reverse` (Alt-click) copies from the first selected object (or ids) onto `source` instead, or with nothing selected what the Eyedropper picked up last (a click without Alt); `append` (Shift+Alt-click) adds the source's fills, strokes and effects on top of each target's stack; placed gradients land at the same place relative to each target's bounds (defaults: fitted to new art); with an object of a dynamic symbol instance selected by Direct Selection and no ids, reverse, append or defaultsOnly, that object takes the source's fill and stroke (solid, none, gradient or pattern) for this instance only, as the Eyedropper Options allow, and a source that is not a path, compound path or type, or options that pick up neither color, are refused. On a path directly in a graph series, the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke and the object's opacity and blend mode (exceptions: docs/mcp.md); on a graph label, the graph stores, for every label of its kind, the character attributes the pick gives all of its text, its object opacity and blend mode, and with `append` its topmost visible fill and stroke rows; on a graph's axis line, tick mark or radar ring, its topmost visible fill and stroke rows and object opacity and blend mode for every line of its kind (a pick of some attributes without `append`: only what it changes) → {ids}",
|
|
|
|
|
has_doc,
|
|
|
|
|
copy_from
|
|
|
|
|
),
|
|
|
|
@@ -147,7 +147,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
|
|
|
|
"Show All Hidden Attributes",
|
|
|
|
|
["Window", "Appearance"],
|
|
|
|
|
None,
|
|
|
|
|
"{ids?|id?, target?} make every hidden fill, stroke and effect (the object's and each item's) of each selected object visible again; errors when nothing is hidden. On a path directly in a graph series (a series group's id stands for those paths and the group), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind → {ids}",
|
|
|
|
|
"{ids?|id?, target?} make every hidden fill, stroke and effect (the object's and each item's) of each selected object visible again; errors when nothing is hidden. On a path directly in a graph series (a series group's id stands for those paths and the group), the graph also stores the paint, weight, opacity and blend mode of the topmost visible fill and stroke (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows and object opacity and blend mode for every label or line of its kind (of a line, only what the edit changes) → {ids}",
|
|
|
|
|
has_doc,
|
|
|
|
|
show_all_hidden
|
|
|
|
|
),
|
|
|
|
@@ -532,7 +532,7 @@ fn require_targets(s: &Session, p: &Value, cmd: &str) -> Result<Vec<NodeId>> {
|
|
|
|
|
/// What the edit changes on the topmost visible fill and stroke of graph series marks, and on the
|
|
|
|
|
/// rows and characters of graph labels, is stored on their graphs in the same step
|
|
|
|
|
/// ([`capture_series_changes`], [`super::graph::capture_label_changes`]), and so are the rows of
|
|
|
|
|
/// the graph lines it reaches ([`super::graph::capture_line_rows`]). Nothing targeted is not
|
|
|
|
|
/// the graph lines it reaches ([`super::graph::capture_line_changes`]). Nothing targeted is not
|
|
|
|
|
/// an edit, and when `f` leaves every target as it was, the document and its undo history stay as
|
|
|
|
|
/// they are.
|
|
|
|
|
pub(crate) fn edit_items(
|
|
|
|
@@ -587,14 +587,27 @@ pub(crate) fn edit_items_then(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let more = after(&before, d, &edited)?;
|
|
|
|
|
// A graph line keeps only the attributes of its rows that the edit changed: the others stay as its kind keeps
|
|
|
|
|
// them, which the line may not show yet.
|
|
|
|
|
rows.retain(|id| !super::graph::is_graph_line(d, *id));
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, &rows);
|
|
|
|
|
// A graph line keeps the rows the edit wrote, also when the line already showed them.
|
|
|
|
|
let lines = super::graph::capture_line_rows(d, &edited);
|
|
|
|
|
let lines = super::graph::capture_line_changes(&before, d, &edited);
|
|
|
|
|
Ok(count_changed(d, &before, &edited) + usize::from(more || labels || lines))
|
|
|
|
|
})?;
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Keep the object rows of the graph labels among `ids` for every label of their kind
|
|
|
|
|
/// ([`super::graph::capture_label_rows`]), and of the graph lines among them only the attributes the edit changed
|
|
|
|
|
/// ([`super::graph::capture_line_changes`]): a line's other attributes stay as its kind keeps them, which the line may
|
|
|
|
|
/// not show yet. Returns whether what a graph keeps changed.
|
|
|
|
|
fn capture_row_edits(before: &vectorcraft_doc::Document, d: &mut vectorcraft_doc::Document, ids: &[NodeId]) -> bool {
|
|
|
|
|
let labels: Vec<NodeId> = ids.iter().copied().filter(|id| !super::graph::is_graph_line(d, *id)).collect();
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, &labels);
|
|
|
|
|
let lines = super::graph::capture_line_changes(before, d, ids);
|
|
|
|
|
labels || lines
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// How many of `ids` differ in `d` from `before`.
|
|
|
|
|
pub(crate) fn count_changed(d: &vectorcraft_doc::Document, before: &vectorcraft_doc::Document, ids: &[NodeId]) -> usize {
|
|
|
|
|
ids.iter().filter(|id| d.node(**id) != before.node(**id)).count()
|
|
|
|
@@ -727,7 +740,7 @@ fn add_item(s: &mut Session, p: &Value, fill: bool) -> Result<Value> {
|
|
|
|
|
let mut rows = top_paint_changed(&before, d, &ids);
|
|
|
|
|
rows.extend(painted_rows(d, added));
|
|
|
|
|
super::graph::capture_series_top_paints(d, &rows);
|
|
|
|
|
super::graph::capture_label_rows(d, &ids);
|
|
|
|
|
capture_row_edits(&before, d, &ids);
|
|
|
|
|
Ok(())
|
|
|
|
|
})?;
|
|
|
|
|
// A fill added above the active row becomes the active row; otherwise the rows above the new
|
|
|
|
@@ -1020,7 +1033,7 @@ fn reduce_basic(s: &mut Session, p: &Value) -> Result<Value> {
|
|
|
|
|
}
|
|
|
|
|
let kept = super::graph::capture_series_opacity(d, &both_kinds(&ids));
|
|
|
|
|
let painted = super::graph::capture_series_top_paints(d, &top_paint_changed(&before, d, &ids));
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, &ids);
|
|
|
|
|
let labels = capture_row_edits(&before, d, &ids);
|
|
|
|
|
Ok(count_changed(d, &before, &ids) + usize::from(kept || painted || labels))
|
|
|
|
|
})?;
|
|
|
|
|
s.active_appearance_item = None;
|
|
|
|
@@ -1096,7 +1109,7 @@ fn set_item(s: &mut Session, p: &Value) -> Result<Value> {
|
|
|
|
|
let mut rows = top_paint_changed(&before, d, &ids);
|
|
|
|
|
rows.extend(painted_rows(d, written));
|
|
|
|
|
let painted = super::graph::capture_series_top_paints(d, &rows);
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, &ids);
|
|
|
|
|
let labels = capture_row_edits(&before, d, &ids);
|
|
|
|
|
Ok(count_changed(d, &before, &ids) + usize::from(kept || painted || labels))
|
|
|
|
|
})?;
|
|
|
|
|
if let Some(pa) = &paint {
|
|
|
|
@@ -1143,7 +1156,7 @@ fn remove_item(s: &mut Session, p: &Value) -> Result<Value> {
|
|
|
|
|
}
|
|
|
|
|
let kept = super::graph::capture_series_opacity(d, &top_opacity_changed(&before, d, &ids));
|
|
|
|
|
let painted = super::graph::capture_series_top_paints(d, &top_paint_changed(&before, d, &ids));
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, &ids);
|
|
|
|
|
let labels = capture_row_edits(&before, d, &ids);
|
|
|
|
|
Ok(count_changed(d, &before, &ids) + usize::from(kept || painted || labels))
|
|
|
|
|
})?;
|
|
|
|
|
// The rows removed from the active row's object, which need not come first in `ids`.
|
|
|
|
@@ -1228,7 +1241,7 @@ fn duplicate_item(s: &mut Session, p: &Value) -> Result<Value> {
|
|
|
|
|
let mut rows = top_paint_changed(&before, d, &ids);
|
|
|
|
|
rows.extend(painted_rows(d, added));
|
|
|
|
|
super::graph::capture_series_top_paints(d, &rows);
|
|
|
|
|
super::graph::capture_label_rows(d, &ids);
|
|
|
|
|
capture_row_edits(&before, d, &ids);
|
|
|
|
|
Ok(())
|
|
|
|
|
})?;
|
|
|
|
|
// Rows at or above each copy move up by one (by the block, for copies placed at `to`).
|
|
|
|
@@ -1268,7 +1281,7 @@ fn show_all_hidden(s: &mut Session, p: &Value) -> Result<Value> {
|
|
|
|
|
}
|
|
|
|
|
super::graph::capture_series_opacity(d, &top_opacity_changed(&before, d, &shown));
|
|
|
|
|
super::graph::capture_series_top_paints(d, &top_paint_changed(&before, d, &shown));
|
|
|
|
|
super::graph::capture_label_rows(d, &shown);
|
|
|
|
|
capture_row_edits(&before, d, &shown);
|
|
|
|
|
Ok(shown)
|
|
|
|
|
})?;
|
|
|
|
|
Ok(json!({ "ids": ids.iter().map(|i| i.0).collect::<Vec<_>>() }))
|
|
|
|
@@ -1314,7 +1327,7 @@ fn move_item(s: &mut Session, p: &Value) -> Result<Value> {
|
|
|
|
|
}
|
|
|
|
|
let kept = super::graph::capture_series_opacity(d, &top_opacity_changed(&before, d, &ids));
|
|
|
|
|
let painted = super::graph::capture_series_top_paints(d, &top_paint_changed(&before, d, &ids));
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, &ids);
|
|
|
|
|
let labels = capture_row_edits(&before, d, &ids);
|
|
|
|
|
Ok(count_changed(d, &before, &ids) + usize::from(kept || painted || labels))
|
|
|
|
|
})?;
|
|
|
|
|
// The moved row stays the active one; the rows it passed shift by one.
|
|
|
|
@@ -1360,7 +1373,7 @@ fn move_items(s: &mut Session, p: &Value, ids: &[NodeId], to: usize) -> Result<V
|
|
|
|
|
}
|
|
|
|
|
let kept = super::graph::capture_series_opacity(d, &top_opacity_changed(&before, d, ids));
|
|
|
|
|
let painted = super::graph::capture_series_top_paints(d, &top_paint_changed(&before, d, ids));
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, ids);
|
|
|
|
|
let labels = capture_row_edits(&before, d, ids);
|
|
|
|
|
Ok(count_changed(d, &before, ids) + usize::from(kept || painted || labels))
|
|
|
|
|
})?;
|
|
|
|
|
let m = idx.len();
|
|
|
|
@@ -1394,7 +1407,7 @@ fn move_contents(s: &mut Session, ids: &[NodeId], to: usize) -> Result<Value> {
|
|
|
|
|
}
|
|
|
|
|
slot.ok_or_else(|| bad("appearance.moveItem", "only groups, layers, type and images have a Contents (Characters) row"))?;
|
|
|
|
|
// A graph label's kind keeps where its rows paint relative to the characters.
|
|
|
|
|
let labels = super::graph::capture_label_rows(d, ids);
|
|
|
|
|
let labels = capture_row_edits(&before, d, ids);
|
|
|
|
|
Ok(count_changed(d, &before, ids) + usize::from(labels))
|
|
|
|
|
})?;
|
|
|
|
|
Ok(json!({ "contents": slot }))
|
|
|
|
@@ -1669,8 +1682,10 @@ fn copy_from(s: &mut Session, p: &Value) -> Result<Value> {
|
|
|
|
|
};
|
|
|
|
|
// `append` adds rows and leaves the characters as they were.
|
|
|
|
|
let text = !append && super::graph::capture_label_text(d, &targets, kept_text, kept_para)?;
|
|
|
|
|
// A graph line is a path: every pick writes its rows.
|
|
|
|
|
let lines = super::graph::capture_line_rows(d, &targets);
|
|
|
|
|
// A graph line is a path: a whole pick and `append` write its rows. A pick of some attributes keeps those it
|
|
|
|
|
// changed, and the rest stay as its kind keeps them, which the line may not show yet.
|
|
|
|
|
let lines =
|
|
|
|
|
if rows_written { super::graph::capture_line_rows(d, &targets) } else { super::graph::capture_line_changes(&before, d, &targets) };
|
|
|
|
|
Ok(count_changed(d, &before, &targets) + usize::from(kept || painted || object || rows || text || lines))
|
|
|
|
|
})?;
|
|
|
|
|
Ok(finish(s, &targets))
|
|
|
|
|