Flattened Text Group always has the identity abs_transform
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 348
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
resvg version: 0.41
The group returned by Text::flattened always has the default abs_transform. usvg::text::flatten::flatten does not propagate the containing Text's abs_transform.
This does not affect resvg since resvg::render::render_group re-calculates abs_transform (Line 56).
All tests pass even after modifying usvg::text::flatten::flatten as follows.
if let Some(path) = span_builder.finish().and_then(|p| {
Path::new(
String::new(),
span.visibility,
span.fill.clone(),
span.stroke.clone(),
span.paint_order,
rendering_mode,
Arc::new(p),
+++ text.abs_transform,
--- Transform::default(),
)
}) {
stroke_bbox = stroke_bbox.expand(path.stroke_bounding_box());
new_paths.push(path);
}
if let Some(path) = span.line_through.as_ref() {
stroke_bbox = stroke_bbox.expand(path.data.bounds());
let mut path = path.clone();
path.rendering_mode = rendering_mode;
new_paths.push(path);
}
}
let mut group = Group {
id: text.id.clone(),
+++ abs_transform: text.abs_transform,
..Group::empty()
};
Is it intended to re-calculate keep abs_transform in resvg andabs_transform in Text::flattened default?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in usvg::text::flatten::flatten and compare its construction of flattened paths and groups with resvg::render::render_group, referenced in the issue. Run the existing test suite and add or update coverage for a Text with a non-default abs_transform; done means the intended transform is preserved consistently without changing existing rendering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100