Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d.c
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
| static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mask_scrollers); | static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mask_scrollers); | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Internal Utilities | /** \name Internal Utilities | ||||
| * \{ */ | * \{ */ | ||||
| BLI_INLINE int clamp_float_to_int(const float f) | BLI_INLINE int clamp_float_to_int(const float f) | ||||
| { | { | ||||
| const float min = INT_MIN; | const float min = (float) INT_MIN; | ||||
| const float max = INT_MAX; | const float max = (float) INT_MAX; | ||||
| if (UNLIKELY(f < min)) { | if (UNLIKELY(f < min)) { | ||||
| return min; | return min; | ||||
| } | } | ||||
| else if (UNLIKELY(f > max)) { | else if (UNLIKELY(f > max)) { | ||||
| return (int)max; | return (int)max; | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 2,180 Lines • Show Last 20 Lines | |||||