From 694a728ec4d25f06528c30ac50f69b43644496e8 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 12 Mar 2022 20:37:01 +1100
Subject: Add LayoutFn type. Refactor some layout functions.

---
 src/components/TileTree.vue | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

(limited to 'src/components/TileTree.vue')

diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue
index 73959ee..ce2688e 100644
--- a/src/components/TileTree.vue
+++ b/src/components/TileTree.vue
@@ -2,12 +2,11 @@
 import {defineComponent} from 'vue';
 import Tile from './Tile.vue';
 
-import {staticSqrLayout, staticRectLayout, sweepToSideLayout, layoutInfoHooks} from '../layout';
-	//for importing f1.ts:
-		//using 'import f1.ts' makes vue-tsc complain, and 'import f1.js' makes vite complain
-		//using 'import f1' might cause problems with build systems other than vite
 import {TolNode, TreeNode, LayoutNode} from '../types';
-let LAYOUT_FUNC = sweepToSideLayout;
+import {genLayout, layoutInfoHooks} from '../layout';
+//regarding importing a file f1.ts:
+	//using 'import f1.ts' makes vue-tsc complain, and 'import f1.js' makes vite complain
+	//using 'import f1' might cause problems with build systems other than vite
 
 import tol from '../tol.json';
 function preprocessTol(tree: any): void {
@@ -73,7 +72,7 @@ export default defineComponent({
 				nodeList[0].children = children;
 		},
 		tryLayout(){
-			let layout = LAYOUT_FUNC(this.tree, 0, 0, this.width, this.height, true);
+			let layout = genLayout(this.tree, 0, 0, this.width, this.height, true);
 			if (layout == null){
 				console.log('Unable to layout tree');
 				return false;
-- 
cgit v1.2.3

