Fix Configuration.MiddleClickDragZoom and rendering artifact if Alt is lifted prematurely#742
Conversation
|
In testing this I noticed another issue, when using Alt + Left Click the box will stop expanding if alt is released, and then the control will be panned as if alt was never pressed. This may be desired behaviour, except that the box will not disappear. |
|
I changed it so if the user releases Alt before they release mouse1 they zoom to that box. Unfortunately if the mouse cursor is still at the point they release Alt it will only do this once they move the mouse again (because it's in the MouseMove handler). Makes me wonder if ScottPlot should support KeyUp/KeyDown events? Although I should admit that I don't know how necessary it is, even in this situation it's not that noticeable unless you're looking for it. Still, if there were a KeyUp event the fix would be much simpler. |
|
Thanks for this PR @bclehmann, and I'm happy you discovered the secondary bug! In the case of prematurely lifting Alt, I called Probably the keypress capture is unnecessary at this time, but something interesting to consider! It would certainly be possible to listen to keypresses, but I suspect this is a pretty niche use case so I'm happy to leave this one like it is 👍 |
New Contributors:
please review CONTRIBUTING.md
Purpose:
Referenced in #741 (comment)
Currently when
Configuration.MiddleClickDragZoomis disabled the rectangle will still be drawn, and it will not disappear upon release of the mouse. With this fix the rectangle will not be drawn at all.New Functionality:
N/A