mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-26 00:07:56 +00:00
Merge main into feat/script-file-folder-write
This commit is contained in:
@@ -24,6 +24,8 @@ impl Session {
|
||||
});
|
||||
// Clicks find an image's own fills and strokes where their effects draw them.
|
||||
vectorcraft_doc::hit::set_image_paint(vectorcraft_render::effects::image_paint);
|
||||
// Clicks inside a clip group fall in the region its clipping path's effects give it.
|
||||
vectorcraft_doc::hit::set_clip_region(vectorcraft_render::effects::reshaped_clip_outline);
|
||||
// Clicks find a blend's steps and an envelope's distorted art where the canvas draws them,
|
||||
// evaluated again when the fonts, the hyphenation exceptions or the plug-ins change.
|
||||
vectorcraft_doc::hit::set_live_art(vectorcraft_render::effects::expand_live, || {
|
||||
@@ -330,6 +332,8 @@ impl Session {
|
||||
// Ruler guides a reader left in the saved list become nodes on their layers.
|
||||
doc.guides_into_nodes();
|
||||
cmd::dimension::conform(&mut doc);
|
||||
// A plane held by Automatic Plane Positioning when the file was saved is back in its place.
|
||||
vectorcraft_tools::distort::perspective::PerspectiveGrid::end_positioning(&mut doc);
|
||||
self.reset_tool_for_doc_switch();
|
||||
let mut st = DocState::new(doc, path);
|
||||
st.history.limit = self.prefs.history_states as usize;
|
||||
@@ -358,6 +362,7 @@ impl Session {
|
||||
doc.resolve_inline_art();
|
||||
doc.guides_into_nodes();
|
||||
cmd::dimension::conform(&mut doc);
|
||||
vectorcraft_tools::distort::perspective::PerspectiveGrid::end_positioning(&mut doc);
|
||||
// In the back, type set in a font named like a composite font is measured again below, in
|
||||
// the document's own composite fonts, not in the front document's.
|
||||
let back = self.active != Some(index);
|
||||
|
||||
@@ -289,6 +289,7 @@ impl Session {
|
||||
variables_highlight: st.variables_highlight.clone(),
|
||||
isolation: st.isolation,
|
||||
perspective_again: None,
|
||||
plane_placed: false,
|
||||
copies: None,
|
||||
move_box: std::sync::OnceLock::new(),
|
||||
});
|
||||
@@ -319,6 +320,7 @@ impl Session {
|
||||
it.preview_paint = None;
|
||||
it.color_mode_paints = None;
|
||||
it.deferred_color_mode = None;
|
||||
it.plane_placed = false;
|
||||
if selection_changed {
|
||||
st.selection.clone_from(&it.selection);
|
||||
}
|
||||
@@ -378,6 +380,7 @@ impl Session {
|
||||
after.clone_from(&paint);
|
||||
}
|
||||
let perspective_again = it.perspective_again.take();
|
||||
let plane_placed = it.plane_placed;
|
||||
let copy = preview.0 == "object.transform" && preview.1.get("copy").and_then(Value::as_bool).unwrap_or(false);
|
||||
// Alt pressed or released during a move drag turns it into a copy or back: name it for
|
||||
// what it did in the end.
|
||||
@@ -395,6 +398,12 @@ impl Session {
|
||||
preview.1.get("dy").and_then(Value::as_f64).unwrap_or(0.0),
|
||||
);
|
||||
st.keep_interaction(it);
|
||||
// The drag drew an object on, or attached one to, the plane Automatic Plane Positioning
|
||||
// held: the plane is back in its place now, as view state (undoing the drag holds it again).
|
||||
if plane_placed && changed && vectorcraft_tools::distort::perspective::PerspectiveGrid::positioning(&st.doc) {
|
||||
vectorcraft_tools::distort::perspective::PerspectiveGrid::end_positioning(Arc::make_mut(&mut st.doc));
|
||||
st.revision += 1;
|
||||
}
|
||||
if preview.0 == "object.transform" && changed {
|
||||
let m = cmd::matrix_param(&preview.1, "matrix");
|
||||
if let Some(m) = m {
|
||||
|
||||
Reference in New Issue
Block a user