-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KnobEventHandler motion event handling broken when using log scale #388
Comments
thanks for the report. |
I just ran into this and it looks like this commit got rid of some calls to Adding a matching call to Lines 446 to 450 in f581516
|
I think I can confirm this on Replacing line 505 of EventHandlers.cpp with this seems to fix: |
doesnt that simply revert the changes to valueTmp? or does the scaling and unscaling do some normalized scale in the end? |
You're right, I just checked and the value before and after is actually the same. I have tried to take inspiration from the scrollEvent handler from a few lines below and did this to no avail, the value instantly jumps to NaN: const float divisor = (ev.mod & kModifierControl) ? accel * 10.f : accel;
valueTmp = (usingLog ? invlogscale(valueTmp) : valueTmp)
+ ((maximum - minimum) / divisor * static_cast<float>(movDiff));
if (usingLog)
valueTmp = logscale(valueTmp); The file has some comments like this: |
I misunderstood the solution given above, changing to this fixes log scale as far as I can tell: const float divisor = (ev.mod & kModifierControl) ? accel * 10.f : accel;
if (usingLog)
valueTmp = invlogscale(valueTmp);
valueTmp += (maximum - minimum) / divisor * static_cast<float>(movDiff);
if (usingLog)
valueTmp = logscale(valueTmp);
|
If you set a knob to use a logarithmic scale, manipulating the knob value by clicking and dragging the mouse on the knob does not work correctly: The value remains on the minimum value or something very close to it. Changing the value using the mouse wheel works correctly.
Can be reproduced with the CairoUI example by inserting the following lines in the constructor:
The text was updated successfully, but these errors were encountered: