Skip to content

Commit

Permalink
Fix context-fill with viewbox
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Apr 19, 2024
1 parent d5d9ff9 commit f594d30
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/resvg/tests/integration/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ use crate::render;
#[test] fn painting_context_with_pattern_objectBoundingBox_in_use() { assert_eq!(render("tests/painting/context/with-pattern-objectBoundingBox-in-use"), 0); }
#[test] fn painting_context_with_pattern_on_marker() { assert_eq!(render("tests/painting/context/with-pattern-on-marker"), 0); }
#[test] fn painting_context_with_text() { assert_eq!(render("tests/painting/context/with-text"), 0); }
#[test] fn painting_context_with_viewbox() { assert_eq!(render("tests/painting/context/with-viewbox"), 0); }
#[test] fn painting_context_without_context_element() { assert_eq!(render("tests/painting/context/without-context-element"), 0); }
#[test] fn painting_display_bBox_impact() { assert_eq!(render("tests/painting/display/bBox-impact"), 0); }
#[test] fn painting_display_none_on_clipPath() { assert_eq!(render("tests/painting/display/none-on-clipPath"), 0); }
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions crates/resvg/tests/tests/painting/context/with-viewbox.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion crates/usvg/src/parser/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,11 @@ fn convert_path(

let mut marker = None;
if marker::is_valid(node) && visibility == Visibility::Visible {
let mut marker_group = Group::empty();
let mut marker_group = Group {
abs_transform: parent.abs_transform,
..Group::empty()
};

let mut marker_state = state.clone();

let bbox = tiny_skia_path
Expand Down

0 comments on commit f594d30

Please sign in to comment.