Add undoable Midra layer reordering with drag and drop
This commit is contained in:
parent
5cf3096c41
commit
ab09812e5f
|
|
@ -41,6 +41,7 @@ pub struct Editor {
|
|||
panning: bool,
|
||||
marquee: Option<Marquee>,
|
||||
align_target: AlignTarget,
|
||||
layer_order: Vec<usize>,
|
||||
keep_aspect_ratio: bool,
|
||||
resize_mode: ResizeMode,
|
||||
format_draft: Option<FormatDraft>,
|
||||
|
|
@ -240,6 +241,7 @@ impl Default for Editor {
|
|||
panning: false,
|
||||
marquee: None,
|
||||
align_target: AlignTarget::Selection,
|
||||
layer_order: Vec::new(),
|
||||
keep_aspect_ratio: true,
|
||||
resize_mode: ResizeMode::Individual,
|
||||
format_draft: None,
|
||||
|
|
@ -457,6 +459,21 @@ impl Editor {
|
|||
self.reference_open = open;
|
||||
}
|
||||
fn sync(&mut self) {
|
||||
let order: Vec<_> = (0..self.layout.layers().len())
|
||||
.map(|i| self.layout.layer_info(i).id)
|
||||
.collect();
|
||||
if order != self.layer_order {
|
||||
if let AlignTarget::Layer(index) = self.align_target {
|
||||
self.align_target = self
|
||||
.layer_order
|
||||
.get(index)
|
||||
.and_then(|id| order.iter().position(|current| current == id))
|
||||
.map(AlignTarget::Layer)
|
||||
.unwrap_or(AlignTarget::Selection);
|
||||
}
|
||||
self.layer_ui.sync_order(&order);
|
||||
self.layer_order = order;
|
||||
}
|
||||
self.fields_edited = false;
|
||||
if self.layout.selected_indices().len() < 2 {
|
||||
self.resize_mode = ResizeMode::Individual;
|
||||
|
|
@ -878,6 +895,7 @@ impl Editor {
|
|||
{
|
||||
self.manage_layers();
|
||||
}
|
||||
let mut reorder = None;
|
||||
for i in 0..self.layout.layers().len() {
|
||||
let y = 28.0 + i as f32 * 44.0;
|
||||
let color = if self.layout.selection_mask()[i] {
|
||||
|
|
@ -911,10 +929,39 @@ impl Editor {
|
|||
let row = ui
|
||||
.interact(
|
||||
Rect::from_min_size(ink.point(0.0, y), Vec2::new(w - 78.0, 38.0)),
|
||||
egui::Id::new(("layer", i)),
|
||||
egui::Sense::click(),
|
||||
egui::Id::new(("layer", self.layout.layer_info(i).id)),
|
||||
egui::Sense::click_and_drag(),
|
||||
)
|
||||
.on_hover_text("Double-click to rename");
|
||||
.on_hover_text("Drag to reorder · double-click to rename");
|
||||
row.dnd_set_drag_payload(layers_ui::LayerDrag(self.layout.layer_info(i).id));
|
||||
if ui.is_enabled() && row.dnd_hover_payload::<layers_ui::LayerDrag>().is_some() {
|
||||
let after = ui.input(|input| {
|
||||
input
|
||||
.pointer
|
||||
.interact_pos()
|
||||
.is_some_and(|p| p.y >= row.rect.center().y)
|
||||
});
|
||||
let y = if after {
|
||||
row.rect.bottom()
|
||||
} else {
|
||||
row.rect.top()
|
||||
};
|
||||
ui.painter().line_segment(
|
||||
[
|
||||
Pos2::new(row.rect.left(), y),
|
||||
Pos2::new(row.rect.right(), y),
|
||||
],
|
||||
Stroke::new(2.0_f32, palette.cyan),
|
||||
);
|
||||
if let Some(payload) = row.dnd_release_payload::<layers_ui::LayerDrag>()
|
||||
&& let Some(from) = (0..self.layout.layers().len())
|
||||
.find(|&j| self.layout.layer_info(j).id == payload.0)
|
||||
{
|
||||
let slot = i + usize::from(after);
|
||||
let to = slot - usize::from(from < slot);
|
||||
reorder = Some((payload.0, to));
|
||||
}
|
||||
}
|
||||
if row.double_clicked() {
|
||||
self.layer_ui.rename = Some((
|
||||
self.layout.layer_info(i).id,
|
||||
|
|
@ -948,6 +995,9 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
}
|
||||
if let Some((id, to)) = reorder {
|
||||
self.reorder_layer(id, to);
|
||||
}
|
||||
let r = r.translate(Vec2::new(
|
||||
0.0,
|
||||
(self.layout.layers().len() as f32 - 2.0) * 44.0,
|
||||
|
|
@ -4316,7 +4366,7 @@ mod tests {
|
|||
let ctx = egui::Context::default();
|
||||
frame(&mut app, &ctx, vec![]);
|
||||
let pos = ctx
|
||||
.read_response(egui::Id::new(("layer", 1_usize)))
|
||||
.read_response(egui::Id::new(("layer", 2_usize)))
|
||||
.unwrap()
|
||||
.rect
|
||||
.center();
|
||||
|
|
@ -4366,7 +4416,7 @@ mod tests {
|
|||
assert!(!app.layout.locked(1));
|
||||
assert!(app.layout.visible(1));
|
||||
let row = ctx
|
||||
.read_response(egui::Id::new(("layer", 1_usize)))
|
||||
.read_response(egui::Id::new(("layer", 2_usize)))
|
||||
.unwrap()
|
||||
.rect;
|
||||
click_shift(&mut app, &ctx, row.center());
|
||||
|
|
@ -4497,7 +4547,7 @@ mod tests {
|
|||
click_shift(&mut app, &ctx, Pos2::new(1180.0, 180.0));
|
||||
assert_eq!(app.layout.selected_indices(), vec![0, 1]);
|
||||
let row = ctx
|
||||
.read_response(egui::Id::new(("layer", 0_usize)))
|
||||
.read_response(egui::Id::new(("layer", 1_usize)))
|
||||
.unwrap()
|
||||
.rect;
|
||||
click_shift(&mut app, &ctx, row.center());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
use super::*;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub(super) struct LayerDrag(pub usize);
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) struct LayerUi {
|
||||
pub open: bool,
|
||||
|
|
@ -12,7 +15,25 @@ pub(super) struct LayerUi {
|
|||
deferred: u8,
|
||||
folder_filter: Option<String>,
|
||||
}
|
||||
impl LayerUi {
|
||||
pub(super) fn sync_order(&mut self, order: &[usize]) {
|
||||
if self.drafts.len() == order.len()
|
||||
&& self.drafts.iter().all(|(id, _, _)| order.contains(id))
|
||||
{
|
||||
self.drafts
|
||||
.sort_by_key(|(id, _, _)| order.iter().position(|current| current == id));
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Editor {
|
||||
pub(super) fn reorder_layer(&mut self, id: usize, to: usize) {
|
||||
match self.layout.move_layer(id, to) {
|
||||
Ok(()) => {
|
||||
self.sync();
|
||||
}
|
||||
Err(e) => self.error = e,
|
||||
}
|
||||
}
|
||||
pub(super) fn names_pending(&self) -> bool {
|
||||
self.layer_ui
|
||||
.drafts
|
||||
|
|
@ -134,12 +155,13 @@ impl Editor {
|
|||
let mut remove = false;
|
||||
let mut refresh = false;
|
||||
let mut sync = false;
|
||||
egui::Window::new("Layers & folders").enabled(!self.format_draft.as_ref().is_some_and(|d| d.pending(&self.layout))).open(&mut open).default_width(650.0).show(ctx, |ui| {
|
||||
let mut reorder = None;
|
||||
egui::Window::new("Layers & folders").enabled(!self.format_draft.as_ref().is_some_and(|d| d.pending(&self.layout))).open(&mut open).default_width(740.0).show(ctx, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
add = ui.add_enabled(self.layout.layers().len() < 256, egui::Button::new("Add layer")).clicked();
|
||||
let count = self.layout.selected_indices().len();
|
||||
remove = ui.add_enabled(count > 0 && count < self.layout.layers().len(), egui::Button::new("Remove selected")).clicked();
|
||||
ui.weak("Add, remove and rename support Undo.");
|
||||
ui.weak("Add, remove, rename and reorder support Undo.");
|
||||
});
|
||||
let stale = self.layer_ui.drafts.len() != self.layout.layers().len() || self.layer_ui.drafts.iter().enumerate().any(|(i, d)| self.layout.layer_info(i).id != d.0);
|
||||
if stale {
|
||||
|
|
@ -154,9 +176,14 @@ impl Editor {
|
|||
});
|
||||
egui::ScrollArea::vertical().max_height(400.0).show(ui, |ui| {
|
||||
egui::Grid::new("layer-management").striped(true).show(ui, |ui| {
|
||||
ui.label("Select / ID"); ui.label("Name"); ui.label("Folder (optional)"); ui.label("Visibility"); ui.label("Protection"); ui.end_row();
|
||||
ui.label("Order"); ui.label("Select / ID"); ui.label("Name"); ui.label("Folder (optional)"); ui.label("Visibility"); ui.label("Protection"); ui.end_row();
|
||||
for (i, (id, name, folder)) in self.layer_ui.drafts.iter_mut().enumerate() {
|
||||
if self.layer_ui.folder_filter.as_ref().is_some_and(|folder| *folder != self.layout.layer_info(i).folder) { continue; }
|
||||
ui.horizontal(|ui| {
|
||||
let unfiltered = self.layer_ui.folder_filter.is_none();
|
||||
if ui.add_enabled(unfiltered && i > 0, egui::Button::new("↑")).on_hover_text("Move up").on_disabled_hover_text("Show all folders to reorder; the first layer cannot move up.").clicked() { reorder = Some((*id, i - 1)); }
|
||||
if ui.add_enabled(unfiltered && i + 1 < self.layout.layers().len(), egui::Button::new("↓")).on_hover_text("Move down").on_disabled_hover_text("Show all folders to reorder; the last layer cannot move down.").clicked() { reorder = Some((*id, i + 1)); }
|
||||
});
|
||||
let selected = self.layout.selection_mask()[i];
|
||||
if ui.selectable_label(selected, format!("{id:02}")).clicked() { self.layout.toggle(i); sync = true; }
|
||||
ui.add_sized([170.0,24.0], egui::TextEdit::singleline(name).char_limit(128));
|
||||
|
|
@ -218,6 +245,9 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
self.layer_ui.open = open;
|
||||
if let Some((id, to)) = reorder {
|
||||
self.reorder_layer(id, to);
|
||||
}
|
||||
if sync {
|
||||
self.sync();
|
||||
}
|
||||
|
|
@ -234,6 +264,117 @@ impl Editor {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
#[test]
|
||||
fn manager_reorders_without_applying_pending_names_and_undo_keeps_alignment_identity() {
|
||||
use super::super::tests::click_text;
|
||||
let ctx = egui::Context::default();
|
||||
let mut app = Editor {
|
||||
align_target: AlignTarget::Layer(0),
|
||||
..Default::default()
|
||||
};
|
||||
app.manage_layers();
|
||||
app.layer_ui.drafts[0].1 = "Camera".into();
|
||||
click_text(&mut app, &ctx, "↓");
|
||||
assert_eq!(app.layout.layer_info(1).id, 1);
|
||||
assert_eq!(app.layout.layer_info(1).name, "Presenter");
|
||||
assert_eq!(app.layer_ui.drafts[1].1, "Camera");
|
||||
assert_eq!(app.align_target, AlignTarget::Layer(1));
|
||||
assert!(app.names_pending());
|
||||
assert!(!app.layer_ui.closing);
|
||||
click_text(&mut app, &ctx, "Apply names & folders");
|
||||
assert_eq!(app.layout.layer_info(1).name, "Camera");
|
||||
app.layout.undo();
|
||||
app.layout.undo();
|
||||
app.sync();
|
||||
assert_eq!(app.layout.layer_info(0).id, 1);
|
||||
assert_eq!(app.layer_ui.drafts[0].0, 1);
|
||||
assert_eq!(app.align_target, AlignTarget::Layer(0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inspector_drag_reorders_once_preserves_selection_and_can_cancel() {
|
||||
use super::super::tests::{frame, mouse};
|
||||
let ctx = egui::Context::default();
|
||||
let mut app = Editor::default();
|
||||
app.layout.add_layer().unwrap();
|
||||
app.layout.select(Some(1));
|
||||
app.sync();
|
||||
let before = midra_layout::project::Project::from_layout(&app.layout);
|
||||
frame(&mut app, &ctx, vec![]);
|
||||
let row = |id| {
|
||||
ctx.read_response(egui::Id::new(("layer", id)))
|
||||
.unwrap()
|
||||
.rect
|
||||
};
|
||||
let start = row(1_usize).center();
|
||||
let end = row(3_usize).center_bottom() - Vec2::new(0.0, 3.0);
|
||||
frame(
|
||||
&mut app,
|
||||
&ctx,
|
||||
vec![egui::Event::PointerMoved(start), mouse(start, true)],
|
||||
);
|
||||
frame(
|
||||
&mut app,
|
||||
&ctx,
|
||||
vec![egui::Event::PointerMoved(start + Vec2::new(0.0, 12.0))],
|
||||
);
|
||||
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(end)]);
|
||||
assert_eq!(
|
||||
midra_layout::project::Project::from_layout(&app.layout),
|
||||
before
|
||||
);
|
||||
frame(&mut app, &ctx, vec![mouse(end, false)]);
|
||||
assert_eq!(
|
||||
(0..3)
|
||||
.map(|i| app.layout.layer_info(i).id)
|
||||
.collect::<Vec<_>>(),
|
||||
[2, 3, 1]
|
||||
);
|
||||
assert_eq!(app.layout.layer_info(app.layout.selected().unwrap()).id, 2);
|
||||
app.layout.undo();
|
||||
app.sync();
|
||||
assert_eq!(
|
||||
midra_layout::project::Project::from_layout(&app.layout),
|
||||
before
|
||||
);
|
||||
frame(&mut app, &ctx, vec![]);
|
||||
frame(
|
||||
&mut app,
|
||||
&ctx,
|
||||
vec![egui::Event::PointerMoved(start), mouse(start, true)],
|
||||
);
|
||||
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(end)]);
|
||||
frame(
|
||||
&mut app,
|
||||
&ctx,
|
||||
vec![egui::Event::Key {
|
||||
key: egui::Key::Escape,
|
||||
physical_key: None,
|
||||
pressed: true,
|
||||
repeat: false,
|
||||
modifiers: egui::Modifiers::NONE,
|
||||
}],
|
||||
);
|
||||
frame(&mut app, &ctx, vec![mouse(end, false)]);
|
||||
assert_eq!(
|
||||
midra_layout::project::Project::from_layout(&app.layout),
|
||||
before
|
||||
);
|
||||
// Releasing outside the list also cancels the reorder.
|
||||
frame(
|
||||
&mut app,
|
||||
&ctx,
|
||||
vec![egui::Event::PointerMoved(start), mouse(start, true)],
|
||||
);
|
||||
let outside = Pos2::new(500.0, 500.0);
|
||||
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(outside)]);
|
||||
frame(&mut app, &ctx, vec![mouse(outside, false)]);
|
||||
assert_eq!(
|
||||
midra_layout::project::Project::from_layout(&app.layout),
|
||||
before
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closing_batch_names_applies_or_discards_without_losing_identity() {
|
||||
let ctx = egui::Context::default();
|
||||
|
|
|
|||
|
|
@ -533,6 +533,39 @@ impl Layout {
|
|||
self.remember(before);
|
||||
Ok(i)
|
||||
}
|
||||
/// Move a stable layer ID to a zero-based list position, as one undoable edit.
|
||||
/// Geometry, input assignments and device links travel with the layer.
|
||||
pub fn move_layer(&mut self, id: usize, to: usize) -> Result<(), String> {
|
||||
let from = self
|
||||
.info
|
||||
.iter()
|
||||
.position(|info| info.id == id)
|
||||
.ok_or("Layer no longer exists.")?;
|
||||
if to >= self.layers.len() {
|
||||
return Err("Layer position is outside the list.".into());
|
||||
}
|
||||
if from == to {
|
||||
return Ok(());
|
||||
}
|
||||
self.finish_drag();
|
||||
let before = self.snapshot();
|
||||
fn move_item<T>(items: &mut [T], from: usize, to: usize) {
|
||||
if from < to {
|
||||
items[from..=to].rotate_left(1);
|
||||
} else {
|
||||
items[to..=from].rotate_right(1);
|
||||
}
|
||||
}
|
||||
move_item(&mut self.info, from, to);
|
||||
move_item(&mut self.layers, from, to);
|
||||
move_item(&mut self.selected, from, to);
|
||||
move_item(&mut self.locked, from, to);
|
||||
move_item(&mut self.visible, from, to);
|
||||
move_item(&mut self.formats.source_for, from, to);
|
||||
move_item(&mut self.formats.advanced, from, to);
|
||||
self.remember(before);
|
||||
Ok(())
|
||||
}
|
||||
pub fn remove_selected(&mut self) -> Result<(), String> {
|
||||
let indices = self.selected_indices();
|
||||
if indices.is_empty() || indices.len() == self.layers.len() {
|
||||
|
|
|
|||
|
|
@ -130,3 +130,93 @@ fn visibility_and_lock_changes_are_local_undoable_edits() {
|
|||
assert!(!layout.locked(0));
|
||||
assert_eq!(*layout.layers(), before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reorder_preserves_complete_layer_identity_history_and_file_order() {
|
||||
use midra_layout::{MidraLink, formats::Framing};
|
||||
let mut layout = Layout::default();
|
||||
layout.add_layer().unwrap();
|
||||
layout.rename_layer(0, "Camera", "Video").unwrap();
|
||||
layout
|
||||
.set_midra_link(
|
||||
0,
|
||||
Some(MidraLink {
|
||||
screen: "2".into(),
|
||||
layer: "1".into(),
|
||||
}),
|
||||
)
|
||||
.unwrap();
|
||||
layout
|
||||
.set_framing(
|
||||
0,
|
||||
Framing {
|
||||
zoom: 2.0,
|
||||
offset: [20.0, -10.0],
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
// Share an input while retaining different per-layer crops.
|
||||
layout
|
||||
.configure(2, 0, layout.formats().sources[0], layout.layers()[2], true)
|
||||
.unwrap();
|
||||
layout.set_locked(0, true);
|
||||
layout.set_visible(0, false);
|
||||
layout.set_selection([false, true, true]);
|
||||
let before = Project::from_layout(&layout);
|
||||
layout.move_layer(1, 2).unwrap();
|
||||
let after = Project::from_layout(&layout);
|
||||
assert_eq!(
|
||||
after.layers.iter().map(|l| l.id).collect::<Vec<_>>(),
|
||||
[2, 3, 1]
|
||||
);
|
||||
for layer in &before.layers {
|
||||
assert_eq!(
|
||||
after.layers.iter().find(|l| l.id == layer.id).unwrap(),
|
||||
layer
|
||||
);
|
||||
}
|
||||
assert_eq!(after.inputs, before.inputs);
|
||||
assert_eq!(after.next_layer_id, before.next_layer_id);
|
||||
assert_eq!(after.editor.selected_layer_ids, [2, 3]);
|
||||
let loaded = Project::from_json(&after.to_json().unwrap())
|
||||
.unwrap()
|
||||
.layout()
|
||||
.unwrap();
|
||||
assert_eq!(Project::from_layout(&loaded), after);
|
||||
let svg = after.to_svg(false).unwrap();
|
||||
assert!(svg.find("layer-2").unwrap() < svg.find("layer-3").unwrap());
|
||||
assert!(svg.find("layer-3").unwrap() < svg.find("layer-1").unwrap());
|
||||
layout.undo();
|
||||
assert_eq!(Project::from_layout(&layout), before);
|
||||
layout.redo();
|
||||
assert_eq!(Project::from_layout(&layout), after);
|
||||
layout.move_layer(1, 0).unwrap();
|
||||
assert_eq!(Project::from_layout(&layout), before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn invalid_and_noop_reorders_leave_history_and_ids_unchanged() {
|
||||
let mut layout = Layout::default();
|
||||
layout.move_layer(1, 1).unwrap();
|
||||
let before = Project::from_layout(&layout);
|
||||
assert!(layout.move_layer(999, 0).is_err());
|
||||
assert!(layout.move_layer(1, 2).is_err());
|
||||
layout.move_layer(1, 1).unwrap();
|
||||
assert_eq!(Project::from_layout(&layout), before);
|
||||
layout.undo();
|
||||
assert_eq!(layout.layer_info(0).id, 1);
|
||||
assert_eq!(layout.layer_info(1).id, 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reordered_stacking_and_hit_testing_follow_document_order() {
|
||||
let mut layout = Layout::default();
|
||||
layout.apply(1, layout.layers()[0]).unwrap();
|
||||
layout.select(None);
|
||||
assert_eq!(layout.layer_info(layout.hit([200.0, 200.0]).unwrap()).id, 2);
|
||||
layout.move_layer(1, 1).unwrap();
|
||||
assert_eq!(layout.layer_info(layout.hit([200.0, 200.0]).unwrap()).id, 1);
|
||||
layout.select(Some(0));
|
||||
// Selected layers retain the editor's existing foreground behavior.
|
||||
assert_eq!(layout.layer_info(layout.hit([200.0, 200.0]).unwrap()).id, 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ leaves the existing file intact.
|
|||
|
||||
## Layer history and export scopes
|
||||
|
||||
Add/remove/rename and folder edits are undoable. Device mappings are not implied
|
||||
Add/remove/rename, reordering and folder edits are undoable. Device mappings are not implied
|
||||
by editor IDs. Selection stores stable layer IDs, not zero-based indices. At
|
||||
least one layer must remain. Visibility and locks remain local protection flags and are undoable.
|
||||
SVG export supports all, visible-only, explicit specific-layer (including hidden)
|
||||
|
|
@ -128,6 +128,14 @@ or selected layers (including a single
|
|||
layer); rectangles retain stable IDs and document stacking order. Names/folders
|
||||
are not added to the geometry SVG format.
|
||||
|
||||
Reordering changes only the order of the existing `layers` array, not IDs or
|
||||
per-layer values. Project v5 and SVG v1 remain unchanged. Moving layer 1 below
|
||||
layer 2 saves IDs in `[2, 1]` order and emits `layer-2` before `layer-1` in SVG.
|
||||
Loading preserves that order; selected-layer exports still follow document order,
|
||||
not selection order. Source slots, `next_layer_id`, names, folders, crop geometry,
|
||||
visibility/locks and Midra links remain attached to their original layer IDs.
|
||||
The editor's temporary selected-layer foreground drawing does not alter file order.
|
||||
|
||||
## SVG geometry exchange, version 1
|
||||
|
||||
Suggested filename: `layout.svg`. UTF-8 SVG with SVG namespace, `width`, `height`
|
||||
|
|
@ -143,7 +151,7 @@ and `viewBox="0 0 W H"` equal to the output screen. The root carries
|
|||
</svg>
|
||||
```
|
||||
|
||||
- IDs are stable editor-slot names `layer-1`, `layer-2`; rectangle order is slot
|
||||
- IDs are stable layer names `layer-1`, `layer-2`; rectangle order is document
|
||||
order, independent of viewport selection/foreground drawing.
|
||||
- Coordinates are the visible box top-left and size, rounded independently to
|
||||
nearest whole pixels; half values round away from zero. Negative coordinates
|
||||
|
|
|
|||
|
|
@ -566,6 +566,16 @@ Use **Layers → Manage layers & folders…** or **Manage…** above the inspect
|
|||
Add layers, select one or more to remove, and apply names/folder labels. These
|
||||
changes support Undo/Redo; at least one layer must remain. Folder filtering helps
|
||||
manage the list without changing stacking order. Lock/Show remain local, undoable flags.
|
||||
Use each row’s **↑ / ↓** buttons in **Layers & folders** to reorder immediately,
|
||||
or drag a layer name in the right-hand list and drop above/below another row.
|
||||
A cyan line marks the drop position; Escape or releasing outside the list cancels.
|
||||
Choose **All folders** to enable the manager’s reorder buttons. Hidden/locked
|
||||
layers can be reordered without changing their flags. Each move is one Undo step;
|
||||
pending names/folders follow their layer. List order is the saved stacking/export
|
||||
order (later rows draw above earlier rows); selected layers still draw in front
|
||||
while editing. Reordering never changes geometry, source assignments or Midra links,
|
||||
and never sends to the device.
|
||||
|
||||
Stable IDs survive removal and are independent of Midra layer numbers. Group
|
||||
movement, alignment and Same-handles resizing work across the selection;
|
||||
Mirror/Opposite resizing still require exactly two layers.
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Reorder layers with manager ↑/↓ buttons or drag-and-drop in the inspector. One-step Undo; IDs, links, crops and pending names follow the layer. Test save/reload and SVG order.
|
||||
|
||||
- `b251798`: Crop zoom/offsets and output resolution apply on edit; position/size applies when leaving a field. Pending drafts prompt Apply/Discard on close; Apply buttons highlight changes. Device sends remain explicit.
|
||||
- Checks: workspace tests, fmt, Clippy and rustdoc passed. Coverage blocked by missing LLVM tools; desktop/hardware acceptance not run.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue