@@ -97,7 +97,7 @@ public: | |||||
/** | /** | ||||
Mouse motion event. | Mouse motion event. | ||||
@param x The widget-relative coordinates of the pointer. | |||||
@param pos The widget-relative coordinates of the pointer. | |||||
@see onMotion | @see onMotion | ||||
*/ | */ | ||||
struct MotionEvent : BaseEvent { | struct MotionEvent : BaseEvent { | ||||
@@ -106,8 +106,8 @@ public: | |||||
/** | /** | ||||
Mouse scroll event. | Mouse scroll event. | ||||
@param pos The scroll distance. | |||||
@param dir The scroll direction. | |||||
@param pos The widget-relative coordinates of the pointer. | |||||
@param delta The scroll distance. | |||||
@see onScroll | @see onScroll | ||||
*/ | */ | ||||
struct ScrollEvent : BaseEvent { | struct ScrollEvent : BaseEvent { | ||||
@@ -117,8 +117,8 @@ public: | |||||
/** | /** | ||||
Resize event. | Resize event. | ||||
@param size The new widget size | |||||
@param oldSize The previous size, may be null | |||||
@param size The new widget size. | |||||
@param oldSize The previous size, may be null. | |||||
@see onResize | @see onResize | ||||
*/ | */ | ||||
struct ResizeEvent { | struct ResizeEvent { | ||||
@@ -135,6 +135,8 @@ void ImageKnob::setDefault(float value) noexcept | |||||
void ImageKnob::setRange(float min, float max) noexcept | void ImageKnob::setRange(float min, float max) noexcept | ||||
{ | { | ||||
DISTRHO_SAFE_ASSERT_RETURN(max > min,); | |||||
if (fValue < min) | if (fValue < min) | ||||
{ | { | ||||
fValue = min; | fValue = min; | ||||
@@ -160,6 +162,11 @@ void ImageKnob::setRange(float min, float max) noexcept | |||||
} | } | ||||
} | } | ||||
if (fValueDef < min) | |||||
fValueDef = min; | |||||
else if (fValueDef > max) | |||||
fValueDef = max; | |||||
fMinimum = min; | fMinimum = min; | ||||
fMaximum = max; | fMaximum = max; | ||||
} | } | ||||
@@ -681,9 +681,9 @@ struct Window::PrivateData { | |||||
return; | return; | ||||
Widget::ScrollEvent ev; | Widget::ScrollEvent ev; | ||||
ev._ = Point<float>(dx, dy); | |||||
ev.mod = static_cast<Modifier>(puglGetModifiers(fView)); | |||||
ev.time = puglGetEventTimestamp(fView); | |||||
ev.delta = Point<float>(dx, dy); | |||||
ev.mod = static_cast<Modifier>(puglGetModifiers(fView)); | |||||
ev.time = puglGetEventTimestamp(fView); | |||||
FOR_EACH_WIDGET_INV(rit) | FOR_EACH_WIDGET_INV(rit) | ||||
{ | { | ||||