Skip to content

SVG: XML contains duplicated content due to uninitialized axis#4441

Merged
swharden merged 3 commits intoScottPlot:mainfrom
sunefred:4436
Nov 4, 2024
Merged

SVG: XML contains duplicated content due to uninitialized axis#4441
swharden merged 3 commits intoScottPlot:mainfrom
sunefred:4436

Conversation

@sunefred
Copy link
Contributor

@sunefred sunefred commented Nov 4, 2024

Partly fixes #4436

This fixes an issue where an uninitialized axis (such as the Right axis for a default Plot) would result in the render counter to max out at five (5) renders. The condition that checks weather an axis has changed or not was updated to correctly handle such an axis where range is [Infinity, -Infinity] (reversed).

Additionally the equality implementation for CoordinateRange was updated. It will now correctly differentiate between [-Infinity, Infinity] and [Infinity, -Infinity].

I am sure there are other reasons that multiple render-passes could happen, in which case the SVG output would still contain duplicated content. This PR only fixes the particular issue with uninitialized axis.

@sunefred sunefred changed the title SVG: XML contains duplicated content SVG: XML contains duplicated content due to uninitialized axis Nov 4, 2024
@swharden
Copy link
Member

swharden commented Nov 4, 2024

Thanks @sunefred, I appreciate you diving down to find the surprisingly nuanced bug underlying this issue! I'll merge this now and it will be in the next release, likely published to NuGet within the next few days or by the end of this weekend at the latest.

Thanks again! 🚀

@swharden swharden enabled auto-merge (squash) November 4, 2024 23:54
@swharden swharden merged commit e08202a into ScottPlot:main Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SVG: XML contains duplicated content

2 participants