aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-10-19 19:14:04 +1100
committerTerry Truong <terry06890@gmail.com>2022-10-19 19:14:04 +1100
commit57d5c70198e711e28ff632d44b7bbb57e826f4fc (patch)
treeaeabbff223b38c9a1e36e82d02381809fbaf39da /src/components
parent8985843a16df94729fb5c264ee60cc29471aaf1c (diff)
For vertical side-mainline display, place mainline on right
Diffstat (limited to 'src/components')
-rw-r--r--src/components/TimeLine.vue17
1 files changed, 4 insertions, 13 deletions
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){