Skip to content

Commit

Permalink
check min/max
Browse files Browse the repository at this point in the history
  • Loading branch information
fx-lange committed Aug 12, 2015
1 parent 65eb5ac commit b294b5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 8 additions & 1 deletion src/ofxNumEdit.cpp
Expand Up @@ -367,7 +367,14 @@ void ofxNumEdit<Type>::setUpdateOnEnterOnly(bool _bUpdateOnEnterOnly){
template<typename Type>
void ofxNumEdit<Type>::setValue(std::string valStr){
bChangedInternally = true;
value = ofToFloat(valStr);
Type tmpVal = ofToFloat(valStr);
cout << tmpVal << endl;
if(tmpVal < getMin()){
tmpVal = getMin();
}else if(tmpVal > getMax()){
tmpVal = getMax();
}
value = tmpVal;
}

template<typename Type>
Expand Down
7 changes: 0 additions & 7 deletions src/ofxNumEdit.h
Expand Up @@ -3,13 +3,6 @@
#include "ofxBaseGui.h"
#include "ofParameter.h"

/*
* TODO
* check min/max
* crash?
* no key spam
* */

template<typename Type>
class ofxNumEdit : public ofxBaseGui{
friend class ofPanel;
Expand Down

0 comments on commit b294b5d

Please sign in to comment.