From 2a0c04245f8ab5017ca96449cca8aeb36336edf3 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 25 Jun 2022 12:10:58 +1000
Subject: Reduce degrees-of-variance in options set

Also add size prop to IconButton
---
 src/components/AncestryBar.vue | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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

diff --git a/src/components/AncestryBar.vue b/src/components/AncestryBar.vue
index a5bb1c0..0f95d00 100644
--- a/src/components/AncestryBar.vue
+++ b/src/components/AncestryBar.vue
@@ -15,10 +15,13 @@ export default defineComponent({
 		uiOpts: {type: Object as PropType<UiOptions>, required: true},
 	},
 	computed: {
+		imgSz(){
+			return this.uiOpts.ancestryBarBreadth - this.lytOpts.tileSpacing*2 - this.uiOpts.scrollGap;
+		},
 		usedNodes(){ // Childless versions of 'nodes' used to parameterise <tile>
 			return this.nodes.map(n => {
 				let newNode = new LayoutNode(n.name, []);
-				newNode.dims = [this.uiOpts.ancestryBarImgSz, this.uiOpts.ancestryBarImgSz];
+				newNode.dims = [this.imgSz, this.imgSz];
 				return newNode;
 			});
 		},
@@ -29,8 +32,8 @@ export default defineComponent({
 				// For child layout
 				display: 'flex',
 				flexDirection: this.vert ? 'column' : 'row',
-				gap: this.uiOpts.ancestryTileGap + 'px',
-				padding: this.uiOpts.ancestryTileGap + 'px',
+				gap: this.lytOpts.tileSpacing + 'px',
+				padding: this.lytOpts.tileSpacing + 'px',
 				// Other
 				backgroundColor: this.uiOpts.ancestryBarBgColor,
 				boxShadow: this.uiOpts.shadowNormal,
-- 
cgit v1.2.3

