diff --git a/SBOLCanvasFrontend/src/app/graph-helpers.ts b/SBOLCanvasFrontend/src/app/graph-helpers.ts index 2400765..89082f8 100644 --- a/SBOLCanvasFrontend/src/app/graph-helpers.ts +++ b/SBOLCanvasFrontend/src/app/graph-helpers.ts @@ -1899,6 +1899,22 @@ export class GraphHelpers extends GraphBase { } } + /** + * Made specifically for redo. + * Adds the circular type back to Circuit Container if circular is present again. + */ + protected addCircularType() { + let allGraphCells = this.graph.getDefaultParent().children + if (allGraphCells != null) { + for (let i = 0; i < allGraphCells.length; i++) { + if (allGraphCells[i].isCircuitContainer() && allGraphCells[i].isCircularBackboneOnCircuitContainer()) { + const otherTypes = this.getGlyphInfo(allGraphCells[i]).otherTypes + otherTypes.push("Circular") + } + } + } + } + protected flipInteractionEdge(cell) { if (!cell.isInteraction()) { console.error("flipInteraction attempted on something other than an interaction!") diff --git a/SBOLCanvasFrontend/src/app/graph.service.ts b/SBOLCanvasFrontend/src/app/graph.service.ts index a5b693b..f47a6e5 100644 --- a/SBOLCanvasFrontend/src/app/graph.service.ts +++ b/SBOLCanvasFrontend/src/app/graph.service.ts @@ -588,6 +588,9 @@ export class GraphService extends GraphHelpers { // If the undo caused scars to become visible, we should update this.showingScars = this.getScarsVisible() + + // Add Circular type property back if needed + this.addCircularType() // refresh to update cell labels if (this.graph.getCurrentRoot()) { @@ -653,10 +656,9 @@ export class GraphService extends GraphHelpers { const childCellName = childCell.style.split("Glyph")[1]?.split(";")[0]?.trim() - // A circular backbone is considered a sequence feature - // "Cir (Circular Backbone Right/Left)" refers to the connection to the backbone - // It's possible to have a circular backbone as a standalone glyph - if(!childCell.isCircularBackbone() || childCellName === "Cir (Circular Backbone)"){ + // Circular Backbone be added after all other children are created + // Prevents both the left and right side from being added + if(!childCell.isCircularBackbone()){ this.addSequenceFeature(childCellName) }