-
Notifications
You must be signed in to change notification settings - Fork 59
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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/[email protected] | |||
pub fn get_bbox(&self) -> Either<BBox, Undefined> { | |||
match self.tree.root.calculate_bbox() { | |||
match self.tree.root.bounding_box { |
There was a problem hiding this comment.
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()
。
等我增加一些测试用例。
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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()
No description provided.