You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After you zoom vertically, using alt+scroll-wheel, zooming horizontally using ctrl+scroll-wheel doesn't work, until the user clicks in, or pans the graph.
To Reproduce
Press alt and scroll to zoom in/out vertically. Release alt, then press ctrl and scroll to zoom horizontally. => You'd expect the graph to zoom horizontally, but nothing happens.
Hi @tomwimmenhove thanks for reporting this, and @StendProg thanks for figuring out the cause of this issue!
@StendProg's solution (#437) fixes the problem on the WinForms control (but it's still present on the WPF control).
An alternative solution here may be to stop using the ALT key. Perhaps CTRL could lock the vertical axis and SHIFT could lock the horizontal axis. Currently SHIFT-click-drag is used to zoom-to-rectangle, but we could give that function to ALT, or even CTRL+SHIFT...
Another alternative option may be to have mousewheel events create call a method to focus the control 50 ms after the wheel event. I'm not sure if this is possible yet. Something like:
I think the best long-term solution here is to avoid using ALT in combination with scroll-wheel actions. ALT can be used with click-drag actions because the control maintains focus. Switching the function of ALT and SHIFT for the WinForms and WPF controls is probably the way to go here. The new list of actions is:
Left-click-drag: pan
Right-click-drag: zoom
Middle-click-drag: zoom region
ALT+Left-click-drag: zoom region
Scroll wheel: zoom to cursor
Right-click: show menu
Middle-click: auto-axis
Double-click: show benchmark
Hold CTRL to lock vertical axis
Hold SHIFT to lock horizontal axis
We might want to consider adding CTRL+SHIFT+right-click-drag as a way to zoom without distorting the ratio (something you currently have to set with Configure(equalAxes: true), #306)
In addition to fixing the original issue, CTRL+SHIFT+right-click-drag now zooms evenly (with a fixed axis ratio). This feels really natural, I like it!
Thanks for initially reporting this @tomwimmenhove and @StendProg for your helpful PR and research into message handling.
Activity
StendProg commentedon May 28, 2020
Hi @tomwimmenhove
This problem is caused by a system event that causes the control to lose focus on
Altkey press.I made PR that fixes this (#437).
If you want a fast solution you can disable main menu of
Formin your application by settingForm.ControlBoxproperty tofalse.Also, loss of focus occurs on an odd
Altpress. Each evenAltpress returns focus...swharden commentedon May 30, 2020
Hi @tomwimmenhove thanks for reporting this, and @StendProg thanks for figuring out the cause of this issue!
@StendProg's solution (#437) fixes the problem on the WinForms control (but it's still present on the WPF control).
An alternative solution here may be to stop using the ALT key. Perhaps CTRL could lock the vertical axis and SHIFT could lock the horizontal axis. Currently SHIFT-click-drag is used to zoom-to-rectangle, but we could give that function to ALT, or even CTRL+SHIFT...
Another alternative option may be to have mousewheel events create call a method to focus the control 50 ms after the wheel event. I'm not sure if this is possible yet. Something like:
[-]Horizontal zoom not working after vertical zooming[/-][+]ALT+ScrollWheel causes loss of focus[/+]swharden commentedon May 31, 2020
I think the best long-term solution here is to avoid using ALT in combination with scroll-wheel actions. ALT can be used with click-drag actions because the control maintains focus. Switching the function of ALT and SHIFT for the WinForms and WPF controls is probably the way to go here. The new list of actions is:
We might want to consider adding CTRL+SHIFT+right-click-drag as a way to zoom without distorting the ratio (something you currently have to set with
Configure(equalAxes: true), #306)switch ALT and SHIFT functions #436
CTRL+SHIFT+right-click-drag zooms evenly #436
swharden commentedon May 31, 2020
In addition to fixing the original issue, CTRL+SHIFT+right-click-drag now zooms evenly (with a fixed axis ratio). This feels really natural, I like it!
Thanks for initially reporting this @tomwimmenhove and @StendProg for your helpful PR and research into message handling.