Skip to content

Commit

Permalink
Fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Gewi413 committed Jul 21, 2023
1 parent 9ccebd7 commit af91eef
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions plotst/axis.typ
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,19 @@
let inversion = if axis.invert_markings == -1 {dist * 2 + size.width} else {0pt}

let title_extra = measure(axis.title, style).height

let sizes = axis.values.map(it => {
let size = measure([#it], style)
if is_vertical(axis) {
return size.width
} else {
return size.height
}
})

let sizes = (0pt,)
if axis.show_values {
sizes = axis.values.map(it => {
let size = measure([#it], style)
if is_vertical(axis) {
return size.width
} else {
return size.height
}
})
}

let size = calc.max(..sizes) + inversion + 2 * dist + title_extra
if is_vertical(axis) {
return (size, 0pt)
Expand Down

0 comments on commit af91eef

Please sign in to comment.