-fix range limit issue in Particles2D, closes #2411

This commit is contained in:
Juan Linietsky 2015-12-31 15:18:03 -03:00
parent bc2b1696e6
commit d1a799f744
2 changed files with 3 additions and 4 deletions

View File

@ -697,7 +697,7 @@ bool Particles2D::is_emitting() const {
void Particles2D::set_amount(int p_amount) {
ERR_FAIL_INDEX(p_amount,1024);
ERR_FAIL_INDEX(p_amount,1024+1);
particles.resize(p_amount);
}
@ -719,7 +719,7 @@ float Particles2D::get_emit_timeout() const {
void Particles2D::set_lifetime(float p_lifetime) {
ERR_FAIL_INDEX(p_lifetime,3600);
ERR_FAIL_INDEX(p_lifetime,3600+1);
lifetime=p_lifetime;
}

View File

@ -2128,8 +2128,7 @@ void Tree::_input_event(InputEvent p_event) {
float diff_y = -b.relative_y;
diff_y=Math::pow(ABS(diff_y),1.8)*SGN(diff_y);
diff_y*=0.1;
range_drag_base=CLAMP(range_drag_base + c.step * diff_y, c.min, c.max);
range_drag_base=CLAMP(range_drag_base + c.step * diff_y, c.min, c.max);
popup_edited_item->set_range(popup_edited_item_col,range_drag_base);
item_edited(popup_edited_item_col,popup_edited_item);