diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-13 22:59:00 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-13 22:59:00 +1100 |
| commit | 33f9e8f4a599ef995ba8608e0f1be79c6ac37155 (patch) | |
| tree | c320aa3752d3ca387aa0ea662226da0fb15ff772 /src/components/TileTree.vue | |
| parent | fecec836f9c5bca72619931d0522f42f67080534 (diff) | |
Fix inconsistent-tileCount-on-layout-fail bug
Diffstat (limited to 'src/components/TileTree.vue')
| -rw-r--r-- | src/components/TileTree.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue index ce3507d..d662f50 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -61,16 +61,20 @@ export default defineComponent({ nodeList[0].children = nodeList[0].tolNode.children.map((n: TolNode) => new LayoutNode(n, [])); layoutInfoHooks.updateLayoutInfoOnExpand(nodeList); //try to re-layout - if (!this.tryLayout()) + if (!this.tryLayout()){ nodeList[0].children = []; + layoutInfoHooks.updateLayoutInfoOnCollapse(nodeList); + } }, onInnerHeaderClicked(nodeList: LayoutNode[]){ //nodeList is an array of layout-nodes, from the clicked-on-tile's node upward let children = nodeList[0].children; nodeList[0].children = []; layoutInfoHooks.updateLayoutInfoOnCollapse(nodeList); - if (!this.tryLayout()) + if (!this.tryLayout()){ nodeList[0].children = children; + layoutInfoHooks.updateLayoutInfoOnExpand(nodeList); + } }, tryLayout(){ let newLayout = genLayout(this.layoutTree, [0,0], [this.width,this.height], true); |
