diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-05-17 08:55:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-05-17 08:55:00 +0300 |
commit | 45863059f7b2335d32631e98632561f4e76b5c61 (patch) | |
tree | f03038c21a8b7e208168e38ec9a4aae025bc3d51 /source/blender/editors/armature/pose_slide.c | |
parent | 67c40cc51cafbf1e0abe8a05ae28765866aeab86 (diff) |
Cleanup: remove commented code, use function to access header region
Diffstat (limited to 'source/blender/editors/armature/pose_slide.c')
-rw-r--r-- | source/blender/editors/armature/pose_slide.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index 55c2204b4ab..f7b54b79601 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -42,6 +42,7 @@ #include "BKE_layer.h" #include "BKE_object.h" #include "BKE_report.h" +#include "BKE_screen.h" #include "BKE_unit.h" #include "RNA_access.h" @@ -528,14 +529,11 @@ static int pose_slide_init(bContext *C, wmOperator *op, ePoseSlide_Modes mode) pso->num.unit_type[0] = B_UNIT_NONE; /* percentages don't have any units... */ /* Register UI drawing callback. */ - /* pso->draw_handle = ED_region_draw_cb_activate( - pso->region->type, pose_slide_draw_2d_slider, pso, REGION_DRAW_POST_PIXEL); */ - LISTBASE_FOREACH (ARegion *, region, &pso->area->regionbase) { - if (region->regiontype == RGN_TYPE_HEADER) { - pso->region = region; - pso->draw_handle = ED_region_draw_cb_activate( - region->type, pose_slide_draw_2d_slider, pso, REGION_DRAW_POST_PIXEL); - } + ARegion *region_header = BKE_area_find_region_type(pso->area, RGN_TYPE_HEADER); + if (region_header != NULL) { + pso->region = region_header; + pso->draw_handle = ED_region_draw_cb_activate( + region_header->type, pose_slide_draw_2d_slider, pso, REGION_DRAW_POST_PIXEL); } /* return status is whether we've got all the data we were requested to get */ |