diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-03 15:24:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-03 15:43:01 +0300 |
commit | ceab47f34790b5598453720fe276e5e6d521c4be (patch) | |
tree | f17bd898acdcef6af90aea351885dd2b48c74dc8 /source/blender/editors/space_info/info_draw.c | |
parent | aee9d9a4a48270878c089c6c371a33c12b670e8b (diff) |
Cleanup: text-view comments, variable names, const args
Diffstat (limited to 'source/blender/editors/space_info/info_draw.c')
-rw-r--r-- | source/blender/editors/space_info/info_draw.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c index f2f8b2da4db..64570459532 100644 --- a/source/blender/editors/space_info/info_draw.c +++ b/source/blender/editors/space_info/info_draw.c @@ -228,7 +228,7 @@ static int report_textview_line_color(struct TextViewContext *tvc, #undef USE_INFO_NEWLINE -static void info_textview_draw_rect_calc(ARegion *ar, rcti *draw_rect) +static void info_textview_draw_rect_calc(const ARegion *ar, rcti *draw_rect) { const int margin = 4 * UI_DPI_FAC; draw_rect->xmin = margin; @@ -239,16 +239,16 @@ static void info_textview_draw_rect_calc(ARegion *ar, rcti *draw_rect) } static int info_textview_main__internal(struct SpaceInfo *sinfo, - ARegion *ar, + const ARegion *ar, ReportList *reports, - int draw, - int mval[2], - void **mouse_pick, - int *pos_pick) + const bool do_draw, + const int mval[2], + void **r_mval_pick_item, + int *r_mval_pick_offset) { int ret = 0; - View2D *v2d = &ar->v2d; + const View2D *v2d = &ar->v2d; TextViewContext tvc = {0}; tvc.begin = report_textview_begin; @@ -271,31 +271,28 @@ static int info_textview_main__internal(struct SpaceInfo *sinfo, info_textview_draw_rect_calc(ar, &tvc.draw_rect); - ret = textview_draw(&tvc, draw, mval, mouse_pick, pos_pick); + ret = textview_draw(&tvc, do_draw, mval, r_mval_pick_item, r_mval_pick_offset); return ret; } -void *info_text_pick(struct SpaceInfo *sinfo, ARegion *ar, ReportList *reports, int mouse_y) +void *info_text_pick(struct SpaceInfo *sinfo, const ARegion *ar, ReportList *reports, int mval_y) { - void *mouse_pick = NULL; - int mval[2]; + void *mval_pick_item = NULL; + const int mval[2] = {0, mval_y}; - mval[0] = 0; - mval[1] = mouse_y; - - info_textview_main__internal(sinfo, ar, reports, 0, mval, &mouse_pick, NULL); - return (void *)mouse_pick; + info_textview_main__internal(sinfo, ar, reports, false, mval, &mval_pick_item, NULL); + return (void *)mval_pick_item; } -int info_textview_height(struct SpaceInfo *sinfo, ARegion *ar, ReportList *reports) +int info_textview_height(struct SpaceInfo *sinfo, const ARegion *ar, ReportList *reports) { int mval[2] = {INT_MAX, INT_MAX}; - return info_textview_main__internal(sinfo, ar, reports, 0, mval, NULL, NULL); + return info_textview_main__internal(sinfo, ar, reports, false, mval, NULL, NULL); } -void info_textview_main(struct SpaceInfo *sinfo, ARegion *ar, ReportList *reports) +void info_textview_main(struct SpaceInfo *sinfo, const ARegion *ar, ReportList *reports) { int mval[2] = {INT_MAX, INT_MAX}; - info_textview_main__internal(sinfo, ar, reports, 1, mval, NULL, NULL); + info_textview_main__internal(sinfo, ar, reports, true, mval, NULL, NULL); } |