Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Improvements #416

Merged
merged 58 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3b32638
proof of concept
fenjalien Dec 6, 2023
c42a30d
Add tip offset for marks
fenjalien Dec 9, 2023
017d862
Fix cubic segments
fenjalien Dec 11, 2023
d0385f0
Add to all mark enabled elemennts
fenjalien Dec 13, 2023
98141c6
Add reversing and slanting
fenjalien Dec 13, 2023
446a1f5
Add harpoon and flip style
fenjalien Dec 14, 2023
a8bc328
Add stealth mark
fenjalien Dec 14, 2023
416c4e4
per mark styling!!!
fenjalien Dec 19, 2023
385e5a2
misc: Remove mark old
johannes-wolf Dec 20, 2023
9c5e66d
shapes: Use new mark API for drawing mark shapes
johannes-wolf Dec 20, 2023
07f40cb
mark: Add some comments
johannes-wolf Dec 20, 2023
ac74219
mark: Move mark shapes to extra file
johannes-wolf Dec 20, 2023
150d029
mark: Support mnemonics
johannes-wolf Dec 20, 2023
9efaa70
mark: Support sep
johannes-wolf Dec 20, 2023
ba392c3
mark: Fix bezier/arc/spline marks
johannes-wolf Dec 20, 2023
79e797e
mark: Fix cubic direction calculation
johannes-wolf Dec 20, 2023
ff54eb8
mark: Change flex behaviour
johannes-wolf Dec 20, 2023
06c16c8
mark: Fix arc marks
johannes-wolf Dec 20, 2023
83d89dc
mark: Add reversing mnemonic
johannes-wolf Dec 20, 2023
ec6228b
mark: More mark shapes
johannes-wolf Dec 20, 2023
ce03b89
mark: Support T marks
johannes-wolf Dec 20, 2023
68bb9c2
marks: Harpoon support for new marks
johannes-wolf Dec 20, 2023
aa90d4a
mark: Add diamond, rect and hook
johannes-wolf Dec 20, 2023
82007ef
mark: Fix hook
johannes-wolf Dec 20, 2023
b3bce7e
manual: Rotate marks
johannes-wolf Dec 20, 2023
0d26e48
Typo
johannes-wolf Dec 20, 2023
e7f1ba1
grouping: Remove place marks
johannes-wolf Dec 20, 2023
e0fa9bb
mark: Fix flex false
johannes-wolf Dec 20, 2023
75aa0e7
mark: Fix tests
johannes-wolf Dec 20, 2023
5a2cfc8
mark: Add straight mark
johannes-wolf Dec 21, 2023
c10a3dd
axes: Change mark to straight
johannes-wolf Dec 21, 2023
b411571
mark: Bracket respect inset
johannes-wolf Dec 21, 2023
6b9ffae
tests: Update some test images
johannes-wolf Dec 21, 2023
e2cc870
mark: Add 3D mark support
johannes-wolf Dec 21, 2023
6c88e4e
mark: Fix reversed mark offset by + base offset
johannes-wolf Dec 21, 2023
9b78c07
tests: Fix tests + update refs
johannes-wolf Dec 21, 2023
37f6b03
mark: Add shape names variable
johannes-wolf Dec 21, 2023
5478138
mark: Add plus, x and star shaped marks
johannes-wolf Dec 21, 2023
a27ed0b
mark: Add barbed mark
johannes-wolf Dec 21, 2023
d330fa0
mark: Add all marks to the documentation
johannes-wolf Dec 21, 2023
68e1842
mark: Fix star mark offset
johannes-wolf Dec 21, 2023
14540ca
post rebase fixups
johannes-wolf Dec 23, 2023
007c1c1
mark: Support linear path extrapolation
johannes-wolf Dec 23, 2023
4c9d1a6
mark: Support offset
johannes-wolf Dec 23, 2023
d29f95c
mark: Fix slanting
johannes-wolf Dec 23, 2023
c260499
mark: Support shortening to a specific mark
johannes-wolf Dec 23, 2023
9e3e28b
bezier: Fix extrema precision bug
johannes-wolf Dec 23, 2023
d354a0d
mark: Fix shorten-to and bezier direction
johannes-wolf Dec 23, 2023
2352a4b
mark: Allow shorten-to none
johannes-wolf Dec 23, 2023
686aaa4
mark: Add assertion messages
johannes-wolf Dec 23, 2023
70aeb9b
mark: Use absolute lengths for the default style
johannes-wolf Dec 23, 2023
24f0b02
mark: Fix offset and shorten-to
johannes-wolf Dec 23, 2023
51539f8
mark: Add back curve start/end correction
johannes-wolf Dec 23, 2023
24e62dd
mark: Add tests with many marks
johannes-wolf Dec 24, 2023
8d5b921
mark: Support angle style key
johannes-wolf Dec 28, 2023
e749294
mark: Cleanup & Port of 75972d
johannes-wolf Dec 28, 2023
469e913
mark: Support path relative offset
johannes-wolf Dec 30, 2023
a980803
mark: Support position override
johannes-wolf Dec 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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