Preserve editor:layer_path through Table<Vector>::into_graphic_table() (#4113)

This commit is contained in:
Keavon Chambers 2026-05-06 02:21:45 -07:00 committed by GitHub
parent 9565d43481
commit 22a6e0d767
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -244,7 +244,14 @@ impl IntoGraphicTable for Table<Graphic> {
impl IntoGraphicTable for Table<Vector> {
fn into_graphic_table(self) -> Table<Graphic> {
Table::new_from_element(Graphic::Vector(self))
// Propagate `editor:layer_path` from item 0 onto the wrapper Graphic row so a subsequent
// `flatten_graphic_table` doesn't overwrite the inner Vector's stamp with an empty value
let layer_path: Table<NodeId> = self.attribute_cloned_or_default(ATTR_EDITOR_LAYER_PATH, 0);
let mut graphic_table = Table::new_from_element(Graphic::Vector(self));
if !layer_path.is_empty() {
graphic_table.set_attribute(ATTR_EDITOR_LAYER_PATH, 0, layer_path);
}
graphic_table
}
}