diff options
| author | Nixon <43715558+nixon-voxell@users.noreply.github.com> | 2024-09-03 20:05:20 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-03 12:05:20 +0000 |
| commit | 4fda03abdc240f7aa8a3853a1a2c674e0cd2f192 (patch) | |
| tree | d0d66400ad2d8ca898509d8a9438dd23550b4a39 /crates/typst-svg | |
| parent | cfde809feb33bc057e860c5128c74fb9df6f030c (diff) | |
Animation-friendly export (#4822)
Diffstat (limited to 'crates/typst-svg')
| -rw-r--r-- | crates/typst-svg/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/typst-svg/src/lib.rs b/crates/typst-svg/src/lib.rs index 145e23f8..deb5fb00 100644 --- a/crates/typst-svg/src/lib.rs +++ b/crates/typst-svg/src/lib.rs @@ -240,6 +240,10 @@ impl SVGRenderer { self.xml.start_element("g"); self.xml.write_attribute("class", "typst-group"); + if let Some(label) = group.label { + self.xml.write_attribute("data-typst-label", label.as_str()); + } + if let Some(clip_path) = &group.clip_path { let hash = hash128(&group); let id = self.clip_paths.insert_with(hash, || shape::convert_path(clip_path)); |
