Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability for UIKnob to have a mapping to "round" values in normali…
…zed space. This allows to have special drag-modes that round values, depending on mouse button used. Example in new Inner Pitch: class InnerPitchKnob : UIImageKnob { public: nothrow: @nogc: this(UIContext context, KnobImage knobImage, Parameter parameter) { super(context, knobImage, parameter); } override double roundParamValue(double normalizedValue, MouseState mstate) { if (mstate.rightButtonDown) { float roundedPitch = cast(int)(0.5 + 48 * normalizedValue); roundedPitch /= 48; if (roundedPitch < 0) roundedPitch = 0; if (roundedPitch > 1) roundedPitch = 1; return roundedPitch; // special drag } else { return normalizedValue; // normal drag } } }
- Loading branch information