Skip to content

Conversation

@CGQAQ
Copy link
Contributor

@CGQAQ CGQAQ commented Jan 28, 2024

No description provided.

@vercel
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 Outdated
// https://github.com/napi-rs/napi-rs/releases/tag/[email protected]
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

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()

@yisibl
Copy link
Member

yisibl commented Sep 24, 2025

备忘:当我们有时间再次回到 resvg 版本升级的时候,记得跑一下这个性能测试:vercel/satori#706

@yisibl yisibl force-pushed the main branch 2 times, most recently from 15dd771 to 34c1451 Compare January 9, 2026 09:56
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