diff options
Diffstat (limited to 'source/blender/editors')
6 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 5b5b69f8153..aae552c274b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5240,12 +5240,12 @@ static int ui_do_but_COLOR( rgb_to_hsv_compat_v(col, hsv); if (event->type == WHEELDOWNMOUSE) - hsv[2] = CLAMPIS(hsv[2] - 0.05f, 0.0f, 1.0f); + hsv[2] = clamp_f(hsv[2] - 0.05f, 0.0f, 1.0f); else if (event->type == WHEELUPMOUSE) - hsv[2] = CLAMPIS(hsv[2] + 0.05f, 0.0f, 1.0f); + hsv[2] = clamp_f(hsv[2] + 0.05f, 0.0f, 1.0f); else { float fac = 0.005 * (event->y - event->prevy); - hsv[2] = CLAMPIS(hsv[2] + fac, 0.0f, 1.0f); + hsv[2] = clamp_f(hsv[2] + fac, 0.0f, 1.0f); } hsv_to_rgb_v(hsv, data->vec); @@ -5963,12 +5963,12 @@ static int ui_do_but_HSVCIRCLE( } /* XXX hardcoded keymap check.... */ else if (event->type == WHEELDOWNMOUSE) { - hsv[2] = CLAMPIS(hsv[2] - 0.05f, 0.0f, 1.0f); + hsv[2] = clamp_f(hsv[2] - 0.05f, 0.0f, 1.0f); ui_but_hsv_set(but); /* converts to rgb */ ui_numedit_apply(C, block, but, data); } else if (event->type == WHEELUPMOUSE) { - hsv[2] = CLAMPIS(hsv[2] + 0.05f, 0.0f, 1.0f); + hsv[2] = clamp_f(hsv[2] + 0.05f, 0.0f, 1.0f); ui_but_hsv_set(but); /* converts to rgb */ ui_numedit_apply(C, block, but, data); } diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c index 4309e913d9e..00462b456ea 100644 --- a/source/blender/editors/interface/interface_region_color_picker.c +++ b/source/blender/editors/interface/interface_region_color_picker.c @@ -585,7 +585,7 @@ static int ui_colorpicker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *blo ui_rgb_to_color_picker_compat_v(rgb, hsv); - hsv[2] = CLAMPIS(hsv[2] + add, 0.0f, 1.0f); + hsv[2] = clamp_f(hsv[2] + add, 0.0f, 1.0f); ui_color_picker_to_rgb_v(hsv, rgb); if (use_display_colorspace) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index e3230d39ae2..b740b410c1a 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2305,7 +2305,7 @@ void ui_hsvcircle_pos_from_vals(uiBut *but, const rcti *rect, float *hsv, float else radius_t = hsv[1]; - radius = CLAMPIS(radius_t, 0.0f, 1.0f) * radius; + radius = clamp_f(radius_t, 0.0f, 1.0f) * radius; *xpos = centx + cosf(-ang) * radius; *ypos = centy + sinf(-ang) * radius; } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 35558bd5af1..38810428382 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1114,7 +1114,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, const wmEvent *event /* some view2d's (graph) don't have min/max zoom, or extreme ones */ if (v2d->maxzoom > 0.0f) - zoomfac = CLAMPIS(0.001f * v2d->maxzoom, 0.001f, 0.01f); + zoomfac = clamp_f(0.001f * v2d->maxzoom, 0.001f, 0.01f); /* x-axis transform */ fac = zoomfac * (event->x - vzd->lastx); diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index f07073cd3d7..a52bf41b9da 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -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); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 54d56dff903..6bc8f5fc36d 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1797,7 +1797,7 @@ static void view_zoom_to_window_xy_camera( { RegionView3D *rv3d = ar->regiondata; const float zoomfac = BKE_screen_view3d_zoom_to_fac(rv3d->camzoom); - const float zoomfac_new = CLAMPIS(zoomfac * (1.0f / dfac), RV3D_CAMZOOM_MIN_FACTOR, RV3D_CAMZOOM_MAX_FACTOR); + const float zoomfac_new = clamp_f(zoomfac * (1.0f / dfac), RV3D_CAMZOOM_MIN_FACTOR, RV3D_CAMZOOM_MAX_FACTOR); const float camzoom_new = BKE_screen_view3d_zoom_from_fac(zoomfac_new); |