Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade resvg to 0.38.0 #293

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Upgrade resvg to 0.38.0 #293

wants to merge 15 commits into from

Conversation

CGQAQ
Copy link
Contributor

@CGQAQ CGQAQ commented Jan 28, 2024

No description provided.

Copy link

vercel bot commented Jan 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
resvg-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 7:05am

src/lib.rs Show resolved Hide resolved
example/image-url.js Outdated Show resolved Hide resolved
src/lib.rs Outdated
@@ -225,7 +224,7 @@ impl Resvg {
// Either<T, Undefined> depends on napi 2.4.3
// https://github.com/napi-rs/napi-rs/releases/tag/napi@2.4.3
pub fn get_bbox(&self) -> Either<BBox, Undefined> {
match self.tree.root.calculate_bbox() {
match self.tree.root.bounding_box {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里新的 API 应该是 abs_bounding_box(),但还需要考虑 SVG 有 stroke 的情况。所以我得看一下是不是要运用 abs_stroke_bounding_box()

等我增加一些测试用例。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加了带有 stroke 的bbox 的测试:#294

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
tree.convert_text(&fontdb);
tree.postprocess(Default::default(), &fontdb);
tree.calculate_abs_transforms();
tree.calculate_bounding_boxes();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我们需要预先计算这两个吗?calculate_abs_transforms()calculate_bounding_boxes()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants