From 57d5c70198e711e28ff632d44b7bbb57e826f4fc Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Wed, 19 Oct 2022 19:14:04 +1100
Subject: For vertical side-mainline display, place mainline on right

---
 src/components/TimeLine.vue | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

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

diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue
index 4df77d9..03097d1 100644
--- a/src/components/TimeLine.vue
+++ b/src/components/TimeLine.vue
@@ -128,10 +128,9 @@ const sideMainline = computed( // True if unable to fit mainline in middle with
 const mainlineOffset = computed(() => { // Distance from side of display area
 	if (!sideMainline.value){
 		return availBreadth.value / 2 - MAINLINE_WIDTH /2 + LARGE_TICK_LEN;
-	} else if (props.vert){
-		return SPACING + LARGE_TICK_LEN;
 	} else {
-		return availBreadth.value - SPACING - tickLabelMargin.value - TICK_LABEL_HEIGHT;
+		return availBreadth.value - SPACING - tickLabelMargin.value
+			- (props.vert ? tickLabelWidth.value : TICK_LABEL_HEIGHT);
 	}
 });
 
@@ -333,16 +332,8 @@ const idToPos = computed(() => {
 					posX + eventMinorSz.value >= availBreadth.value / 2 - MAINLINE_WIDTH / 2 - SPACING){
 				posX = availBreadth.value / 2 + MAINLINE_WIDTH / 2 + SPACING;
 			}
-		} else {
-			if (props.vert){
-				if (posX <= SPACING + MAINLINE_WIDTH + SPACING){
-					posX = SPACING + MAINLINE_WIDTH + SPACING;
-				}
-			} else {
-				if (posX + eventMinorSz.value + SPACING > mainlineOffset.value){
-					break;
-				}
-			}
+		} else if (posX + eventMinorSz.value + SPACING > mainlineOffset.value){
+			break;
 		}
 		// Add coords
 		if (props.vert){
-- 
cgit v1.2.3

