summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLU Jialin <luxxxlucy@gmail.com>2023-10-02 22:22:33 +0800
committerGitHub <noreply@github.com>2023-10-02 16:22:33 +0200
commit34ebbaeb1082b82b4f38d0b8da9a07675127ed79 (patch)
treed2e1c74d2abc1754d43be25cb6ddf9f134962ca4
parent07e3fde54cdb8764077c789a15858ad1de468d32 (diff)
Passing color to the augment line in matrix (#2281)
-rw-r--r--crates/typst-library/src/math/matrix.rs1
-rw-r--r--tests/ref/bugs/mat-aug-color.pngbin0 -> 1680 bytes
-rw-r--r--tests/typ/bugs/mat-aug-color.typ9
3 files changed, 10 insertions, 0 deletions
diff --git a/crates/typst-library/src/math/matrix.rs b/crates/typst-library/src/math/matrix.rs
index dd30209a..68f7f438 100644
--- a/crates/typst-library/src/math/matrix.rs
+++ b/crates/typst-library/src/math/matrix.rs
@@ -378,6 +378,7 @@ fn layout_mat_body(
let default_stroke_thickness = DEFAULT_STROKE_THICKNESS.scaled(ctx);
let default_stroke = FixedStroke {
thickness: default_stroke_thickness,
+ paint: TextElem::fill_in(ctx.styles()),
line_cap: LineCap::Square,
..Default::default()
};
diff --git a/tests/ref/bugs/mat-aug-color.png b/tests/ref/bugs/mat-aug-color.png
new file mode 100644
index 00000000..d6ab0239
--- /dev/null
+++ b/tests/ref/bugs/mat-aug-color.png
Binary files differ
diff --git a/tests/typ/bugs/mat-aug-color.typ b/tests/typ/bugs/mat-aug-color.typ
new file mode 100644
index 00000000..c2e617d6
--- /dev/null
+++ b/tests/typ/bugs/mat-aug-color.typ
@@ -0,0 +1,9 @@
+// https://github.com/typst/typst/issues/2268
+// The augment line should be of the same color as the text
+#set text(
+ font: "New Computer Modern",
+ lang: "en",
+ fill: yellow,
+)
+
+$mat(augment: #1, M, v) arrow.r.squiggly mat(augment: #1, R, b)$