Skip to content

Commit

Permalink
Merge pull request #416 from johannes-wolf/fenjalient-mark-improvements
Browse files Browse the repository at this point in the history
Mark Improvements
  • Loading branch information
johannes-wolf authored Jan 14, 2024
2 parents b1cbb7a + a980803 commit dd25eea
Show file tree
Hide file tree
Showing 42 changed files with 1,147 additions and 761 deletions.
8 changes: 4 additions & 4 deletions src/bezier.typ
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
let (left, right) = split-rec((s, c1, c2, e), t, (), ())

return ((left.at(0), left.at(3), left.at(1), left.at(2)),
(right.at(0), right.at(3), right.at(1), right.at(2)))
(right.at(3), right.at(0), right.at(2), right.at(1)))
}

/// Approximate cubic curve length
Expand Down Expand Up @@ -364,9 +364,9 @@
// curve by using the abc formula for finding roots of
// the curves first derivative.
let dim-extrema(a, b, c1, c2) = {
let f0 = 3*(c1 - a)
let f1 = 6*(c2 - 2*c1 + a)
let f2 = 3*(b - 3*c2 + 3*c1 - a)
let f0 = calc.round(3*(c1 - a), digits: 8)
let f1 = calc.round(6*(c2 - 2*c1 + a), digits: 8)
let f2 = calc.round(3*(b - 3*c2 + 3*c1 - a), digits: 8)

if f1 == 0 and f2 == 0 {
return ()
Expand Down
4 changes: 3 additions & 1 deletion src/canvas.typ
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@
vertices += coordinates
}
}

if type(drawable.stroke) == dictionary and "thickness" in drawable.stroke and type(drawable.stroke.thickness) != typst-length {
drawable.stroke.thickness *= length
}
path(
stroke: drawable.stroke,
fill: drawable.fill,
Expand Down
Loading

0 comments on commit dd25eea

Please sign in to comment.