Skip to content

Interaction.PlotActions improvement#3305

Merged
swharden merged 6 commits intoScottPlot:mainfrom
Nils-Berghs:main
Jan 26, 2024
Merged

Interaction.PlotActions improvement#3305
swharden merged 6 commits intoScottPlot:mainfrom
Nils-Berghs:main

Conversation

@Nils-Berghs
Copy link

A fix for #3304

This fix stores the plot actions assigned to the Interaction in seperate field during disabled periods (e.g, when dragging axis lines).
It restores the actions on Enable

/// <summary>
/// Disable all mouse interactivity
/// </summary>
public void Disable()
{
    //back up the enabled plot actions
    EnabledPlotActions = Actions;
    Actions = PlotActions.NonInteractive();
}

/// <summary>
/// Enable mouse interactivity using the default mouse actions
/// </summary>
public void Enable()
{
    Actions = EnabledPlotActions;
}

@swharden
Copy link
Member

Elegant solution! Thanks for this PR @Nils-Berghs, I'll merge it now and it will be in the next release 🚀

@swharden swharden enabled auto-merge January 26, 2024 23:32
@swharden swharden merged commit 03444d9 into ScottPlot:main Jan 26, 2024
@swharden swharden linked an issue Jan 27, 2024 that may be closed by this pull request
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.

Interaction.PlotActions are not respected

3 participants