Skip to content

Commit

Permalink
piet-svg: Update svg (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Oct 23, 2024
1 parent 6a59f1a commit 9bf40d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion piet-svg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ font-kit = "0.14.2"
image = { version = "0.25.4", default-features = false, features = ["png"] }
piet = { version = "=0.6.2", path = "../piet" }
rustybuzz = "0.20.0"
svg = "0.13.1"
svg = "0.18.0"

[dev-dependencies]
piet = { version = "=0.6.2", path = "../piet", features = ["samples"] }
5 changes: 2 additions & 3 deletions piet-svg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl piet::RenderContext for RenderContext {
// small fiddle factor in to cover the difference between the top of the line and the top
// of the ascender (currently 6% of the font height, calculated by eye).
let y = pos.y + 0.06 * layout.size().height;
let mut text = svg::node::element::Text::new()
let mut text = svg::node::element::Text::new(layout.text())
.set("x", x)
.set("y", y)
.set("dominant-baseline", "hanging")
Expand Down Expand Up @@ -312,8 +312,7 @@ impl piet::RenderContext for RenderContext {
color,
anchor,
),
)
.add(svg::node::Text::new(layout.text()));
);

let affine = self.current_transform();
if affine != Affine::IDENTITY {
Expand Down

0 comments on commit 9bf40d1

Please sign in to comment.