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
Problem with Round cap and dash-strokearray #508
Comments
Hm, I see the problem - this basically happens if the caps overlap. Using |
I can see in #191 what you wanted to achieve, and in my opinion there is no need to make a lot of work out of it. |
Agreed - thanks. I will see if can do this |
- overlapping cups led to a crash - see svg-net#508 - workaround to avoid the crash and not deviate too much from correct drawing
- overlapping cups led to a crash - see svg-net#508 - workaround to avoid the crash and not deviate too much from correct drawing
@MichaelBjerregaard - you can have a look at the PR. I added your test to make sure your example doesn't crash, and a simpler example (shown in the PR) to check the functionality. |
Thank you for acting so swift.
It looks good.
Fra: mrbean-bremen <notifications@github.com>
Sendt: 10. juli 2019 21:04
Til: vvvv/SVG <SVG@noreply.github.com>
Cc: Michael Bjerregaard <mbp@rib-software.dk>; Mention <mention@noreply.github.com>
Emne: Re: [vvvv/SVG] Problem with Round cap and dash-strokearray (#508)
@MichaelBjerregaard<https://github.com/MichaelBjerregaard> - you can have a look at the PR. I added your test to make sure your example doesn't crash, and a simpler example (shown in the PR) to check the functionality.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#508>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AK5Y23HI4GV4W6CYM3AZW6LP6YXCTANCNFSM4H64CLAA>.
|
- overlapping cups led to a crash - fixes svg-net#508 - workaround to avoid the crash and not deviate too much from correct drawing
Description
In the attached SVG the dasharray (1.40 , 1.00) first becomes (0.56, 0.40) in SVGVisualElement line 291.
When adjusting for round cap, it becomes (1.56, -0.59) which is invalid.
Changing line 303 to
pattern[i] = Math.Abs(pen.DashPattern[i] + offset);
will avoid the exception, but will probably not paint a correct dash.
Example data
SVG1155.svg.txt
DashArrayTests.cs.txt
Used Versions
master branch
The text was updated successfully, but these errors were encountered: