Use absolute distance when scrolling audio box with mouse wheel
Instead of 1/3 screen per tick. So the distance of scroll no longer depends on the width of the audio box. Besides, 1/3 is feels to far for me when the audio box is wide. See wangqr/Aegisub#5
This commit is contained in:
parent
716c2eae0d
commit
0a2a07ba7e
1 changed files with 1 additions and 2 deletions
|
@ -129,10 +129,9 @@ END_EVENT_TABLE()
|
||||||
void AudioBox::OnMouseWheel(wxMouseEvent &evt) {
|
void AudioBox::OnMouseWheel(wxMouseEvent &evt) {
|
||||||
if (!ForwardMouseWheelEvent(audioDisplay, evt))
|
if (!ForwardMouseWheelEvent(audioDisplay, evt))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool zoom = evt.CmdDown() != OPT_GET("Audio/Wheel Default to Zoom")->GetBool();
|
bool zoom = evt.CmdDown() != OPT_GET("Audio/Wheel Default to Zoom")->GetBool();
|
||||||
if (!zoom) {
|
if (!zoom) {
|
||||||
int amount = -evt.GetWheelRotation() * GetClientSize().GetWidth() / (evt.GetWheelDelta() * 3);
|
int amount = -evt.GetWheelRotation();
|
||||||
// If the user did a horizontal scroll the amount should be inverted
|
// If the user did a horizontal scroll the amount should be inverted
|
||||||
// for it to be natural.
|
// for it to be natural.
|
||||||
if (evt.GetWheelAxis() == 1) amount = -amount;
|
if (evt.GetWheelAxis() == 1) amount = -amount;
|
||||||
|
|
Loading…
Reference in a new issue