summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-22 06:02:24 +0000
committerDavid Robillard <d@drobilla.net>2008-11-22 06:02:24 +0000
commit91575b926a29fab3d8cfab439b99198be032a45f (patch)
tree6e8762e78a810e3cd2931c3a227f4f7ff6e84db7 /src
parentb0d6d38f9bfb33916b17f20cbeae30cd1f05007b (diff)
downloadingen-91575b926a29fab3d8cfab439b99198be032a45f.tar.gz
ingen-91575b926a29fab3d8cfab439b99198be032a45f.tar.bz2
ingen-91575b926a29fab3d8cfab439b99198be032a45f.zip
Tolerate plugins with nonsense ranges (fix ticket #268).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1762 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/client/NodeModel.cpp3
-rw-r--r--src/gui/Controls.cpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp
index 2975ecff..9e966f63 100644
--- a/src/client/NodeModel.cpp
+++ b/src/client/NodeModel.cpp
@@ -203,6 +203,9 @@ NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max) c
min = min_atom.get_float();
if (max_atom.type() == Atom::FLOAT)
max = max_atom.get_float();
+
+ if (max <= min)
+ max = min + 1.0;
}
diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp
index 27de1259..70d0ebc2 100644
--- a/src/gui/Controls.cpp
+++ b/src/gui/Controls.cpp
@@ -201,6 +201,8 @@ SliderControl::port_variable_change(const string& key, const Atom& value)
void
SliderControl::set_range(float min, float max)
{
+ if (min <= min)
+ max = min + 1.0;
_slider->set_range(min, max);
//_value_spinner->set_range(min, max);
}