Commit ea81e99f authored by artificiel's avatar artificiel
Browse files

CropFilter: cache fill in fill_ for event dispatch

parent 09db86de
......@@ -78,8 +78,18 @@ class CropFilter
float get_fill()
{
auto fill = ofClamp(parameters_.count_.get() / parameters_.capacity_.get(), 0, 1);
if (fill > .02) return fill;
return 0;
fill_ = fill;
if (fill < 0.02) {
fill_ = 0;
} else {
fill_ = fill;
}
return fill_;
}
float get_pan() {
return ofMap(parameters_.pos_->x, -4, 4, 0, 1);
}
void draw_floor(ofColor color, float size, std::string label)
......@@ -160,6 +170,7 @@ class CropFilter
CropFilterParameterGroup parameters_;
glm::vec3 min_, max_;
ofColor color_;
ofParameter<float> fill_;
size_t index_;
float distance_ = 10000;
ofMaterial material_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment