Skip to content

Commit de9e82d

Browse files
Typst 0.13.1 fixes (#834)
* canvas: Fix the fix * tests: Update * mark: Fix symbol regression #830
1 parent 328d2fe commit de9e82d

File tree

34 files changed

+30
-13
lines changed

34 files changed

+30
-13
lines changed

src/canvas.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
for i in range(1, pts.len()) {
130130
vertices.push(curve.line(pts.at(i)))
131131
}
132-
last-point = pts.at(1)
132+
last-point = pts.last()
133133
}
134134
}
135135

src/mark.typ

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,17 @@
385385
if style == none {
386386
style = (start: none, end: none, symbol: none)
387387
}
388+
let both-symbol = style.at("symbol", default: none)
388389
let start-symbol = style.at("start",
389-
default: style.at("symbol", default: none))
390+
default: both-symbol)
391+
if start-symbol == none {
392+
start-symbol = both-symbol
393+
}
390394
let end-symbol = style.at("end",
391-
default: style.at("symbol", default: none))
395+
default: both-symbol)
396+
if end-symbol == none {
397+
end-symbol = both-symbol
398+
}
392399

393400
let (path, is-transformed) = if not style.at("transform-shape", default: true) and transform != none {
394401
(drawable.apply-transform(transform, path).first(), true)

tests/anchor-centroid/ref/1.png

-10 Bytes
Loading

tests/angle/ref/1.png

10 Bytes
Loading

tests/arrows/ref/1.png

3.3 KB
Loading

tests/arrows/test.typ

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#set page(width: auto, height: auto)
22
#import "/src/lib.typ": *
3+
#import "/tests/helper.typ": *
34

4-
#box(stroke: 2pt + red, canvas({
5+
#test-case({
56
import draw: *
67

78
let next(mark) = {
@@ -31,9 +32,9 @@
3132
for m in marks {
3233
next((start: m))
3334
}
34-
}))
35+
} )
3536

36-
#box(stroke: 2pt + red, canvas({
37+
#test-case({
3738
import draw: *
3839

3940
line((0,0), (9,0), stroke: blue + 1pt)
@@ -48,9 +49,9 @@
4849
line((x * .5, -1), (x * .5, 0), mark: (start: ">", end: ">",
4950
width: (x / 50 + .05)))
5051
}
51-
}))
52+
})
5253

53-
#box(stroke: 2pt + red, canvas({
54+
#test-case({
5455
import draw: *
5556

5657
line((0,0), (9,0), stroke: blue + 1pt)
@@ -65,9 +66,9 @@
6566
line((x * .5, -1), (x * .5, 0), mark: (start: "<", end: "<",
6667
width: (x / 50 + .05)))
6768
}
68-
}))
69+
})
6970

70-
#box(stroke: 2pt + red, canvas({
71+
#test-case({
7172
import draw: *
7273

7374
line((0,0), (9,0), stroke: blue + 1pt)
@@ -82,9 +83,9 @@
8283
line((x * .5, -1), (x * .5, 0), mark: (start: "<", end: ">",
8384
width: (x / 50 + .05)))
8485
}
85-
}))
86+
})
8687

87-
#box(stroke: 2pt + red, canvas({
88+
#test-case({
8889
import draw: *
8990

9091
line((0,0), (9,0), stroke: blue + 1pt)
@@ -99,4 +100,13 @@
99100
line((x * .5, -1), (x * .5, 0), mark: (start: "<", end: ">",
100101
width: (x / 50 + .05)))
101102
}
102-
}))
103+
})
104+
105+
// Issue #830
106+
#test-case({
107+
import draw: *
108+
line((0, 0), (1, 0), mark: (start: "stealth"))
109+
line((0, -1), (1, -1), mark: (end: "stealth"))
110+
line((0, -2), (1, -2), mark: (start: "stealth", end: "stealth"))
111+
line((0, -3), (1, -3), mark: (symbol: "stealth",))
112+
})

tests/circle-through/ref/1.png

19 Bytes
Loading
-13 Bytes
Loading

tests/content-padding/ref/1.png

-258 Bytes
Loading

tests/content-rtl/ref/1.png

7 Bytes
Loading

0 commit comments

Comments
 (0)