diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-04 23:35:59 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-04 23:35:59 +1100 |
| commit | dfdfa7f2b466eeae566a9890dcc34cefdf368a39 (patch) | |
| tree | e7282deccfd4a560e2146e884852ccaeded9bc69 /src/components/TileTree.vue | |
| parent | 5d0e4fcbc7eb6faecba9260ed248169de3584fd9 (diff) | |
Increase basicRectsLayout() general-usability
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 3de358b..4c3b34d 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -22,6 +22,7 @@ export default { let hOffset = (this.isRoot ? 0 : this.HEADER_SZ); let x = 0, y = hOffset, w = this.width, h = this.height - hOffset; //return this.basicSquaresLayout(this.tree.children, 0, hOffset, this.width, this.height - hOffset); + //return this.basicRectsLayout(this.tree.children, 0, hOffset, this.width, this.height - hOffset); return this.sweepToSideLayout(this.tree.children, 0, hOffset, this.width, this.height - hOffset); } }, @@ -77,9 +78,12 @@ export default { let score = 0; for (let r = 0; r < nr; r++){ for (let c = 0; c < nc; c++){ - score -= Math.abs(grid[r][c] - (rowProp[r] * colProp[c])); + if (grid[r][c] > 0){ + score -= Math.abs(grid[r][c] - (rowProp[r] * colProp[c])); + } } } + //also score for w/h occupation? if (score > bestScore){ bestScore = score; numCols = nc; @@ -177,7 +181,7 @@ export default { class="transition-all duration-300 ease-out border border-stone-900"> <img v-if="tree.children.length == 0" :src="'/src/assets/' + tree.tolNode.name + '.jpg'" :alt="tree.tolNode.name" - class="hover:cursor-pointer" @click="onImgClick" + class="h-full hover:cursor-pointer" @click="onImgClick" /> <div v-else> <div v-if="!isRoot" :style="{height: HEADER_SZ + 'px'}" |
