Skip to content

Commit

Permalink
Merge pull request #12325 from carolhmj/geFixItemDuplication
Browse files Browse the repository at this point in the history
[GUI Editor] Fix item duplication when gui editor is opened through the playground.
  • Loading branch information
carolhmj authored Apr 5, 2022
2 parents 323d21a + df5050c commit e8c4e11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/tools/guiEditor/src/diagram/workbench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,12 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
this.props.globalState.draggedControlDirection === DragOverLocation.CENTER
) {
draggedControlParent.removeControl(draggedControl);
const liveGui = this.props.globalState.liveGuiTexture;
if (liveGui) {
if (liveGui.rootContainer.children.indexOf(draggedControl) !== -1) {
liveGui.rootContainer.removeControl(draggedControl);
}
}
(dropLocationControl as Container).addControl(draggedControl);
} else if (dropLocationControl.parent) {
//dropping inside the controls parent container
Expand Down

0 comments on commit e8c4e11

Please sign in to comment.