diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/editors/screen/area_utils.c | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/editors/screen/area_utils.c')
-rw-r--r-- | source/blender/editors/screen/area_utils.c | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/source/blender/editors/screen/area_utils.c b/source/blender/editors/screen/area_utils.c index 2137d98d226..1a99210b73d 100644 --- a/source/blender/editors/screen/area_utils.c +++ b/source/blender/editors/screen/area_utils.c @@ -42,18 +42,20 @@ /** * Callback for #ARegionType.message_subscribe */ -void ED_region_generic_tools_region_message_subscribe( - const struct bContext *UNUSED(C), - struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), - struct bScreen *UNUSED(screen), struct ScrArea *UNUSED(sa), struct ARegion *ar, - struct wmMsgBus *mbus) +void ED_region_generic_tools_region_message_subscribe(const struct bContext *UNUSED(C), + struct WorkSpace *UNUSED(workspace), + struct Scene *UNUSED(scene), + struct bScreen *UNUSED(screen), + struct ScrArea *UNUSED(sa), + struct ARegion *ar, + struct wmMsgBus *mbus) { - wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { - .owner = ar, - .user_data = ar, - .notify = ED_region_do_msg_notify_tag_redraw, - }; - WM_msg_subscribe_rna_anon_prop(mbus, WorkSpace, tools, &msg_sub_value_region_tag_redraw); + wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { + .owner = ar, + .user_data = ar, + .notify = ED_region_do_msg_notify_tag_redraw, + }; + WM_msg_subscribe_rna_anon_prop(mbus, WorkSpace, tools, &msg_sub_value_region_tag_redraw); } /** @@ -61,23 +63,23 @@ void ED_region_generic_tools_region_message_subscribe( */ int ED_region_generic_tools_region_snap_size(const ARegion *ar, int size, int axis) { - if (axis == 0) { - /* Note, this depends on the icon size: see #ICON_DEFAULT_HEIGHT_TOOLBAR. */ - const float snap_units[] = {2 + 0.8f, 4 + 0.8f}; - const float aspect = BLI_rctf_size_x(&ar->v2d.cur) / (BLI_rcti_size_x(&ar->v2d.mask) + 1); - int best_diff = INT_MAX; - int best_size = size; - for (uint i = 0; i < ARRAY_SIZE(snap_units); i += 1) { - const int test_size = (snap_units[i] * U.widget_unit) / (UI_DPI_FAC * aspect); - const int test_diff = ABS(test_size - size); - if (test_diff < best_diff) { - best_size = test_size; - best_diff = test_diff; - } - } - return best_size; - } - return size; + if (axis == 0) { + /* Note, this depends on the icon size: see #ICON_DEFAULT_HEIGHT_TOOLBAR. */ + const float snap_units[] = {2 + 0.8f, 4 + 0.8f}; + const float aspect = BLI_rctf_size_x(&ar->v2d.cur) / (BLI_rcti_size_x(&ar->v2d.mask) + 1); + int best_diff = INT_MAX; + int best_size = size; + for (uint i = 0; i < ARRAY_SIZE(snap_units); i += 1) { + const int test_size = (snap_units[i] * U.widget_unit) / (UI_DPI_FAC * aspect); + const int test_diff = ABS(test_size - size); + if (test_diff < best_diff) { + best_size = test_size; + best_diff = test_diff; + } + } + return best_size; + } + return size; } /** \} */ |