From 48adb0e668d1118b6c5ef4a8bfb479ef10113813 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 15 Oct 2022 16:27:48 +1100
Subject: Make new timelines copy existing ones

---
 src/components/BaseLine.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/src/components/BaseLine.vue b/src/components/BaseLine.vue
index e2cf7c8..82507c1 100644
--- a/src/components/BaseLine.vue
+++ b/src/components/BaseLine.vue
@@ -81,8 +81,8 @@ function spanStyles(range: TimelineRange){
 	let styles: Record<string,string>;
 	let availLen = props.vert ? height.value : width.value;
 	// Determine positions in full timeline
-	let startFrac = (range.startYear - MIN_DATE.year) / (MAX_DATE.year - MIN_DATE.year);
-	let lenFrac = (range.endYear - range.startYear) / (MAX_DATE.year - MIN_DATE.year);
+	let startFrac = (range.start.year - MIN_DATE.year) / (MAX_DATE.year - MIN_DATE.year);
+	let lenFrac = (range.end.year - range.start.year) / (MAX_DATE.year - MIN_DATE.year);
 	let startPx = Math.max(0, availLen * startFrac); // Prevent negatives due to end-padding
 	let lenPx = Math.min(availLen - startPx, availLen * lenFrac);
 	lenPx = Math.max(1, lenPx); // Prevent zero length
-- 
cgit v1.2.3

