Browse Source

Misc fixing

gh-pages
falkTX 9 years ago
parent
commit
db54afbbf4
3 changed files with 15 additions and 8 deletions
  1. +5
    -5
      dgl/Widget.hpp
  2. +7
    -0
      dgl/src/ImageKnob.cpp
  3. +3
    -3
      dgl/src/Window.cpp

+ 5
- 5
dgl/Widget.hpp View File

@@ -97,7 +97,7 @@ public:

/**
Mouse motion event.
@param x The widget-relative coordinates of the pointer.
@param pos The widget-relative coordinates of the pointer.
@see onMotion
*/
struct MotionEvent : BaseEvent {
@@ -106,8 +106,8 @@ public:

/**
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
*/
struct ScrollEvent : BaseEvent {
@@ -117,8 +117,8 @@ public:

/**
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
*/
struct ResizeEvent {


+ 7
- 0
dgl/src/ImageKnob.cpp View File

@@ -135,6 +135,8 @@ void ImageKnob::setDefault(float value) noexcept

void ImageKnob::setRange(float min, float max) noexcept
{
DISTRHO_SAFE_ASSERT_RETURN(max > min,);

if (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;
fMaximum = max;
}


+ 3
- 3
dgl/src/Window.cpp View File

@@ -681,9 +681,9 @@ struct Window::PrivateData {
return;

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)
{


Loading…
Cancel
Save