Skip to content

Fix - Support for draggable plottables on AxisIndex 0 and 1#1556

Merged
swharden merged 11 commits intoScottPlot:masterfrom
BambOoxX:multi-axis-draggable
Jan 16, 2022
Merged

Fix - Support for draggable plottables on AxisIndex 0 and 1#1556
swharden merged 11 commits intoScottPlot:masterfrom
BambOoxX:multi-axis-draggable

Conversation

@BambOoxX
Copy link
Contributor

  • Former behavior only worked for AxisIndex 0

This PR is related to the discussion on #1545

There is still work to generalize this to other axis indexes, but I don't know to reach other axes at the moment.

@swharden
Copy link
Member

FYI, I added some draggable lines to the multi-axis lock WinForms demo in this PR branch to facilitate testing...

Demo Menu Screenshot
image image

Previously only primary (index 0) and secondary (index 1) axes were supported by GetDraggableUnderMouse(). This commit supports all possible axes.
Previously mouse intersections were computed for all draggables whether DragEnabled was true or false. This change only checks enabled draggables for mouse intersections, increasing MouseMove performance for plots with disabled draggables.
Previously only primary (index 0) and secondary (index 1) axes were supported. This commit supports all possible axes.
@swharden
Copy link
Member

I have to put this down for tonight but I can pick it up in the morning. It's really close to working properly now, but the horizontal line on third axis still isn't properly draggable. I think it's because its snap height is being calculated improperly 🤔

If you figure it out before I get to it next, feel free to commit a fix! Otherwise I'll pick it up in the morning 👍

@BambOoxX
Copy link
Contributor Author

BambOoxX commented Jan 16, 2022

I have to put this down for tonight but I can pick it up in the morning. It's really close to working properly now, but the horizontal line on third axis still isn't properly draggable. I think it's because its snap height is being calculated improperly 🤔

It's funny, I feel its working properly on my side. Can you elaborate the wrong behavior ?

EDIT I see what you mean now ^^

@BambOoxX
Copy link
Contributor Author

@swharden just fixed the snapped distance.

@swharden
Copy link
Member

@swharden just fixed the snapped distance

I stared at that for a while last night but I didn't realize what I was doing wrong until I saw 03c5771 - axes should be pulled from the plottable, not passed in as arguments - great catch!

Thanks so much for your work on this PR! 👍 🚀

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.

IDraggable: Add multi-axis support Axis Lines: add support for dragging on multi-axis plots

2 participants