|
|
|
@ -248,6 +248,18 @@
|
|
|
|
this.label = label;
|
|
|
|
this.label = label;
|
|
|
|
this.attributes = {};
|
|
|
|
this.attributes = {};
|
|
|
|
this.appendDefaultAttributes(label);
|
|
|
|
this.appendDefaultAttributes(label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Try to keep old attributes if name matches and old value is still valid
|
|
|
|
|
|
|
|
for (const attribute of redoLabel.attributes) {
|
|
|
|
|
|
|
|
for (const oldAttribute of undoLabel.attributes) {
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
attribute.name === oldAttribute.name
|
|
|
|
|
|
|
|
&& validateAttributeValue(undoAttributes[oldAttribute.id], attribute)
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
this.attributes[attribute.id] = undoAttributes[oldAttribute.id];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
const redoAttributes = { ...this.attributes };
|
|
|
|
const redoAttributes = { ...this.attributes };
|
|
|
|
|
|
|
|
|
|
|
|
this.history.do(
|
|
|
|
this.history.do(
|
|
|
|
|