Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed the quadratic to cubic curve "degree elevation" algorithm, which made an incorrect assignment of the degree of a quadratic curve when applying the well-known degree elevation formula for converting to the next degree (cubic in this case).
I spent hours on this to make sure the older code really was in error, doing the equation many different ways to make sure I got the same results each time, and comparing against every implementation I've ever seen for EPS and PDF (SVG supports directly-specific quadratic curves). I have a good feeling for how the coding error happened, as the coordinate transforms WOULD be correct if going to a fourth order curve (and then an extra control point would be needed, still using the same formula).
I augmented the comments but retained the original commenting style and words in order to minimize the overall changes. As the file apparently hadn't been updated since 2015, I also bumped the copyright range to 2020 to cover these new edits.
I did not pull in fixes from other forks, but reviewed them all, and am using the ones that are graphics oriented in my local private branch, but none of them touch the code that I edited tonight so there should be no incompatibilities or conflicts if those other forks by other contributors are merged into the main code base later on.
I have another commit to do tomorrow that is unrelated and isn't part of the graphics handling. I thought it best to decouple the changes in two separate commits, as it is still easy to see the combined changes once the second commit is done.