mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-31 05:46:46 -06:00
M3: component properties keep their order on rename; Make slot asks for the name (#1536, #1537) (#1565)
Properties were listed by name, so a rename moved one. Components now keep prop_order (the names as they were made; a rename keeps the place) and every listing follows it. Make slot opens a name field under the frame's Slot row; Enter makes the slot, Escape cancels, a taken name keeps the field open.
This commit is contained in:
@@ -19,7 +19,17 @@ fn png() -> Vec<u8> {
|
||||
fn published() -> (Document, figcraft_doc::NodeId, String) {
|
||||
let mut d = Document::new("Kit");
|
||||
let p = d.first_page().unwrap();
|
||||
let tile = d.create(p, NodeKind::Component { description: String::new(), props: Default::default() }, "Tile", 0.0, 0.0, 10.0, 10.0).unwrap();
|
||||
let tile = d
|
||||
.create(
|
||||
p,
|
||||
NodeKind::Component { description: String::new(), props: Default::default(), prop_order: Vec::new() },
|
||||
"Tile",
|
||||
0.0,
|
||||
0.0,
|
||||
10.0,
|
||||
10.0,
|
||||
)
|
||||
.unwrap();
|
||||
let (hash, _, _) = add_image(&mut d, png()).unwrap();
|
||||
d.get_mut(tile).unwrap().fills = vec![Paint::image(hash.clone(), ImageScaleMode::Fill)];
|
||||
let snap = d.clone();
|
||||
|
||||
Reference in New Issue
Block a user