@babylonjs/gui-editor 5.49.0 → 5.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42444,9 +42444,11 @@ class WorkbenchComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
|
42444
42444
|
}
|
42445
42445
|
});
|
42446
42446
|
liveRoot.clearControls();
|
42447
|
+
const originalToCloneMap = new Map();
|
42447
42448
|
const updatedRootChildren = this.trueRootContainer.children.slice(0);
|
42448
42449
|
for (const child of updatedRootChildren) {
|
42449
42450
|
const clone = child.clone(this.props.globalState.liveGuiTexture);
|
42451
|
+
originalToCloneMap.set(child, clone);
|
42450
42452
|
liveRoot.addControl(clone);
|
42451
42453
|
}
|
42452
42454
|
// Relink all meshes
|
@@ -42458,6 +42460,7 @@ class WorkbenchComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
|
42458
42460
|
}
|
42459
42461
|
}
|
42460
42462
|
});
|
42463
|
+
this._syncConnectedLines(updatedRootChildren, originalToCloneMap);
|
42461
42464
|
}
|
42462
42465
|
}
|
42463
42466
|
_reorderGrid(grid, draggedControl, dropLocationControl) {
|
@@ -42660,6 +42663,21 @@ class WorkbenchComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
|
42660
42663
|
this._processSelectionOnUp = false;
|
42661
42664
|
}
|
42662
42665
|
}
|
42666
|
+
_syncConnectedLines(controlList, originalToCloneMap) {
|
42667
|
+
for (const control of controlList) {
|
42668
|
+
if (control.getClassName() === "Line") {
|
42669
|
+
const lineControl = control;
|
42670
|
+
if (lineControl.connectedControl) {
|
42671
|
+
const connectedControl = lineControl.connectedControl;
|
42672
|
+
const clonedLine = originalToCloneMap.get(lineControl);
|
42673
|
+
const clonedConnectedControl = originalToCloneMap.get(connectedControl);
|
42674
|
+
if (clonedLine && clonedConnectedControl) {
|
42675
|
+
clonedLine.connectedControl = clonedConnectedControl;
|
42676
|
+
}
|
42677
|
+
}
|
42678
|
+
}
|
42679
|
+
}
|
42680
|
+
}
|
42663
42681
|
_copyLiveGUIToEditorGUI() {
|
42664
42682
|
if (this.props.globalState.liveGuiTexture && this.trueRootContainer) {
|
42665
42683
|
// Create special IDs that will allow us to know which cloned control corresponds to its original
|
@@ -42667,10 +42685,14 @@ class WorkbenchComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
|
42667
42685
|
control.metadata = { ...(control.metadata ?? {}), editorUniqueId: (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.RandomGUID)() };
|
42668
42686
|
});
|
42669
42687
|
this.trueRootContainer.clearControls();
|
42688
|
+
const originalToCloneMap = new Map();
|
42670
42689
|
for (const control of this.props.globalState.liveGuiTexture.rootContainer.children) {
|
42671
42690
|
const cloned = control.clone(this.props.globalState.guiTexture);
|
42691
|
+
originalToCloneMap.set(control, cloned);
|
42672
42692
|
this.appendBlock(cloned);
|
42673
42693
|
}
|
42694
|
+
// Synchronize existing connectedControls
|
42695
|
+
this._syncConnectedLines(this.props.globalState.liveGuiTexture.rootContainer.children, originalToCloneMap);
|
42674
42696
|
}
|
42675
42697
|
}
|
42676
42698
|
createGUICanvas(embed) {
|