Skip to content

Commit

Permalink
tests: Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Feb 7, 2024
1 parent 3452cc1 commit d32bfce
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/draw/shapes.typ
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,14 @@
if style.frame != none {
drawables.push(border)
}

// Because of precision problems with some fonts (e.g. "Source Sans 3")
// we need to round the block sizes up. Otherwise unwanted hyphenization
// gets introduced.
let round-up(v, digits: 8) = {
calc.ceil(v * calc.pow(10, digits)) / calc.pow(10, digits)
}

drawables.push(
drawable.content(
anchors.center,
Expand All @@ -881,8 +889,8 @@
border.segments,
typst-rotate(angle,
block(
width: calc.round(width, digits: 4) * ctx.length,
height: calc.round(height, digits: 4) * ctx.length,
width: round-up(width) * ctx.length,
height: round-up(height) * ctx.length,
inset: (
top: padding.at("top", default: 0) * ctx.length,
left: padding.at("left", default: 0) * ctx.length,
Expand Down
Binary file modified tests/line/element-element/ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/annotation/ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/linearization/ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/spline/ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/reverse-axis/ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d32bfce

Please sign in to comment.