Skip to content

Improve mouse interactions in controls #999

@kirsan31

Description

@kirsan31

Tasks

This section was added by @swharden

Original Question

Your Environment

  • ScottPlot Version: 4.1.12 beta
  • Operating System: Win10 20H2
  • Is it a GUI app? What platform? WinForms
  • .Net: net472 and net5.0-windows was checked.

Simple Mdi Winforms app. Child form with only formsPlot1 on it. MouseLeave and MouseEnter not working, MouseMove is working.

This is critical to implement some info on MouseMove (to hide it after we leave the plot).

P.s. Related question:
How to properly implement axes cursor on MouseMove with ScottPlot?
image

I was tring something like this:

private void formsPlot1_MouseMove(object sender, MouseEventArgs e)
{
    (double x, double y) = formsPlot1.GetMouseCoordinates();
    _HLine.Y = y;
    _HLine.IsVisible = true;
    _VLine.X = x;
    _VLine.IsVisible = true;
    formsPlot1.Render(skipIfCurrentlyRendering: true);
}

And it's worked BUT. Because of _HLine and _VLine are plots, ScottPlot autozoom and autoaxes always trying to consider their values. And this lead to whole wrong behavior. For example:

sp.mp4

Cursors must be completely excluded from plotting logic.

Also, is it possible to display Cursor coordinates on the axes (red circles on screen above)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions