Skip to content

AxisManager: Improve AutoScale() support for inverted axes#4110

Merged
swharden merged 3 commits intoScottPlot:mainfrom
BrianAtZetica:AutoScaleInvertedAxes
Jul 27, 2024
Merged

AxisManager: Improve AutoScale() support for inverted axes#4110
swharden merged 3 commits intoScottPlot:mainfrom
BrianAtZetica:AutoScaleInvertedAxes

Conversation

@BrianAtZetica
Copy link
Contributor

When axes are set to inverted and then an AutoScale is initiated (i.e. middle mouse button) the plot was restoring the axes back to normal directions.

This was caused by the optional parameters on AutoScale being defaulted to false instead of null.
The subsequent use of the null-coalescing operator '??' was therefore having no purpose.

Now the default is null, so if no local parameters are provided AutoScaler parameters are used to decide on axis direction

…ameters passed in. Therefore, input parameters should default to null
@swharden swharden changed the title BugFix: AutoScale should keep inverted Axes AxisManager: Improve AutoScale() support for inverted axes Jul 27, 2024
@swharden
Copy link
Member

Great catch @BrianAtZetica, thanks! This will be in the next release 🚀

@swharden swharden merged commit b358202 into ScottPlot:main Jul 27, 2024
@BrianAtZetica BrianAtZetica deleted the AutoScaleInvertedAxes branch July 28, 2024 05:11
@drolevar
Copy link
Contributor

@BrianAtZetica Thank you very much! It was necessary.

@wi-fr
Copy link

wi-fr commented Nov 9, 2024

It seems that the bug fix applied here got lost again in a later release. In 5.0.43 any Mouse action restores the axes to their default orientation.

@swharden
Copy link
Member

swharden commented Nov 9, 2024

It seems that the bug fix applied here got lost again in a later release. In 5.0.43 any Mouse action restores the axes to their default orientation.

Thanks for pointing this out @wi-fr! I opened #4471 to track reproducing and fixing this issue in the relatively new user input processor. The new system allows automated testing, so we can add tests to ensure this behavior is implemented and does not experience regression again in the future 👍

swharden added a commit that referenced this pull request Nov 9, 2024
* MultiAxisLimits: remove unused Recall() overload

* CoordinateRangeMutable: modify Set() to respect inverted ranges

resolves #4471

* Test: ensure inverted axes are preserved throughout mouse drag events

#4471 #4110

* Update CHANGELOG.md
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.

4 participants