-
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
Polyline/polygon bounding box cuts off part of miter joint #305
Comments
Yes, it could be an upstream problem. You need to clone the latest resvg and run:
You'll see that the bbox has a red border. By the way, in what scenarios do you use Crop by BBox? |
I use it when generating shapes programmatically so that I don't have to calculate the svg viewbox. |
It appears that the problem is in resvg. The polyline svg's bbox is especially broken. Maybe @RazrFalcon can look into this? |
Also, what is the difference between the green and red borders? |
Path bbox calculation is correct. The Red rectangle - path bbox. Meaning the issue is with the way resvg-js reinterprets resvg/usvg output. |
Yes, This requires resvg-js to update resvg to the latest version. |
The tips of miter joints in polygons, polylines and paths are cut-off when
Crop by BBox
is selected.Rect shapes rotated 45 degrees are also affected when stroke is applied.
It seems that the bbox calculations do not include the full length of the miter.
This might be a bug in the underlying
resvg
library, but I'm not sure howresvg-js
performs cropping.Polyline: Before cropping
Polyline: After cropping
Path: Before cropping
Path: After cropping
Rotated rect: Before cropping
Rotated rect: After cropping
Polyline svg
Path svg
Rect svg
The text was updated successfully, but these errors were encountered: