From 0c8b0a7513ccf457556db1486beb092265c594a3 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 15 Oct 2022 14:15:46 +1100
Subject: Make BaseLine spans use TimeLine start/end offsets

Change TimelineRange to hold years not HistDates
---
 src/components/TimeLine.vue | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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

diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue
index 22069bc..281f4e4 100644
--- a/src/components/TimeLine.vue
+++ b/src/components/TimeLine.vue
@@ -630,7 +630,13 @@ function onShiftWheel(evt: WheelEvent){
 
 // For bound-change signalling
 watch(startDate, () => {
-	emit('range-chg', [startDate.value, endDate.value]);
+	let startYear = startDate.value.year;
+	let endYear = endDate.value.year;
+	if (scale.value != MONTH_SCALE && scale.value != DAY_SCALE){ // Possibly incorporate offsets
+		startYear -= startOffset.value * scale.value;
+		endYear += endOffset.value * scale.value;
+	}
+	emit('range-chg', [startYear, endYear]);
 });
 
 // For skipping transitions on startup (and on horz/vert swap)
-- 
cgit v1.2.3

