mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-22 00:21:18 +01:00
Fix assertion due to adjustment value being zero
wx3 on OSX has changed how the mouse wheel delta is calculated. Prior to wx3, it was simply set to 1 so the wheel rotaion value was simply increments of one. With wx3, higher resolution devices (like touchpads) are supported so the value for wheel rotation can be a fraction of the delta, so it is possible to pass a zero value to the NumericConverter::Adjust() method. Therefore, the method just returns in this case.
This commit is contained in:
@@ -1019,6 +1019,12 @@ void NumericConverter::Decrement()
|
|||||||
|
|
||||||
void NumericConverter::Adjust(int steps, int dir)
|
void NumericConverter::Adjust(int steps, int dir)
|
||||||
{
|
{
|
||||||
|
// It is possible and "valid" for steps to be zero if a
|
||||||
|
// high precision device is being used and wxWidgets supports
|
||||||
|
// reporting a higher precision...Mac wx3 does.
|
||||||
|
if (steps == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
wxASSERT(dir == -1 || dir == 1);
|
wxASSERT(dir == -1 || dir == 1);
|
||||||
wxASSERT(steps > 0);
|
wxASSERT(steps > 0);
|
||||||
if (steps < 0)
|
if (steps < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user