Stroke-width and BoundingBox
See original GitHub issueHi, I’ve a simple text with the stroke-width parameter set at “0.001px”, when I try to render this into the WpfTestSvgSample I have a bounding box bigger that my text. If I set the parameter at “0.002px” or bigger the issue disappear. I try to find the error in the code but I still don’t know where it could be.
I try to solve it by adding a simple line into the GetStrokeWidth() function
strokeWidthLength.Value = Math.Max(strokeWidthLength.Value, 0.002);
but I know it’s an orrible solution.
Have you any solution for this?
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
How to get the bounding box of an SVG line or path ...
If I have a line with a stroke width of x, the height or width of the line should account for it. In...
Read more >Stroke width not being taken into account for path ...
Bounding box incorrect: image. Workaround Adding a rectangle to the shape layer (in additon to the path) that's large enough to be outside ......
Read more >Why does the dimension of an object rely on stroke width?
My current process is to draw the box, change the stroke width to zero, ... Tools "Set Bounding Box to Geometric" is the...
Read more >SVGGraphicsElement: getBBox() method - Web APIs | MDN
An options dictionary used to control which parts of the element are included in the bounding box. The available options are: fill. A...
Read more >Unable to compute stroke width variation - MATLAB Answers
Compute the aspect ratio using bounding box data. bbox = vertcat(mserStats.BoundingBox); w = bbox(:,3); h = bbox(:,4); aspectRatio = w.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found another case with the same problem, and the fix does not work. Probably it’s due to the position of the red circle.
file.zip
@LucaPassarella Yes, it was clear. On investigating, I found it was resulting from the translation transform applied after the drawing is rendered to try and position it within the viewbox. As I stated, it was a work around the issue, since I could not tell why applying the transform changes the size in such case. What I did was to get the size of the drawing before and after applying the transform, if it changes, I discard the transform all together.