Cleanup: use clamp_* from BLI_math (replace macro)

This commit is contained in:
2018-06-17 11:50:56 +02:00
parent 36e82b7759
commit 2f1e34cfcc
12 changed files with 21 additions and 19 deletions

View File

@@ -771,7 +771,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (cuts != lcd->cuts) {
/* allow zero so you can backspace and type in a value
* otherwise 1 as minimum would make more sense */
lcd->cuts = CLAMPIS(cuts, 0, SUBD_CUTS_MAX);
lcd->cuts = clamp_i(cuts, 0, SUBD_CUTS_MAX);
RNA_int_set(op->ptr, "number_cuts", (int)lcd->cuts);
ringsel_find_edge(lcd, (int)lcd->cuts);
show_cuts = true;
@@ -779,7 +779,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
if (smoothness != lcd->smoothness) {
lcd->smoothness = CLAMPIS(smoothness, -SUBD_SMOOTH_MAX, SUBD_SMOOTH_MAX);
lcd->smoothness = clamp_f(smoothness, -SUBD_SMOOTH_MAX, SUBD_SMOOTH_MAX);
RNA_float_set(op->ptr, "smoothness", lcd->smoothness);
show_cuts = true;
ED_region_tag_redraw(lcd->ar);