diff options
author | Julian Eisel <julian@blender.org> | 2020-03-06 18:56:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-03-06 19:19:23 +0300 |
commit | b2ee1770d4c31078518f4ec9edd5196a41345162 (patch) | |
tree | 6b7f6ff9057322245fc3b3407bece3f1c0cb3eb5 /source/blender/editors/mask/mask_draw.c | |
parent | b825a95ec311a169d33fe21e28418f11a516c82f (diff) |
Cleanup: Rename ARegion variables from ar to region
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
Diffstat (limited to 'source/blender/editors/mask/mask_draw.c')
-rw-r--r-- | source/blender/editors/mask/mask_draw.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 71aa860d703..3f3bf8b7510 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -677,7 +677,7 @@ static float *mask_rasterize(Mask *mask, const int width, const int height) void ED_mask_draw_region( Depsgraph *depsgraph, Mask *mask_, - ARegion *ar, + ARegion *region, const char draw_flag, const char draw_type, const char overlay_mode, @@ -693,7 +693,7 @@ void ED_mask_draw_region( /* optional - only used when do_post_draw is set or called from clip editor */ const bContext *C) { - struct View2D *v2d = &ar->v2d; + struct View2D *v2d = ®ion->v2d; Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, &mask_->id); /* aspect always scales vertically in movie and image spaces */ @@ -708,13 +708,13 @@ void ED_mask_draw_region( float xofs, yofs; /* find window pixel coordinates of origin */ - UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x, &y); + UI_view2d_view_to_region(®ion->v2d, 0.0f, 0.0f, &x, &y); /* w = BLI_rctf_size_x(&v2d->tot); */ /* h = BLI_rctf_size_y(&v2d->tot); */ - zoomx = (float)(BLI_rcti_size_x(&ar->winrct) + 1) / BLI_rctf_size_x(&ar->v2d.cur); - zoomy = (float)(BLI_rcti_size_y(&ar->winrct) + 1) / BLI_rctf_size_y(&ar->v2d.cur); + zoomx = (float)(BLI_rcti_size_x(®ion->winrct) + 1) / BLI_rctf_size_x(®ion->v2d.cur); + zoomy = (float)(BLI_rcti_size_y(®ion->winrct) + 1) / BLI_rctf_size_y(®ion->v2d.cur); if (do_scale_applied) { zoomx /= width; @@ -780,22 +780,23 @@ void ED_mask_draw_region( GPU_matrix_scale_2f(maxdim, maxdim); if (do_draw_cb) { - ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); + ED_region_draw_cb_draw(C, region, REGION_DRAW_PRE_VIEW); } /* draw! */ draw_mask_layers(C, mask_eval, draw_flag, draw_type, width, height); if (do_draw_cb) { - ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); + ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_VIEW); } GPU_matrix_pop(); } -void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra, const int efra) +void ED_mask_draw_frames( + Mask *mask, ARegion *region, const int cfra, const int sfra, const int efra) { - const float framelen = ar->winx / (float)(efra - sfra + 1); + const float framelen = region->winx / (float)(efra - sfra + 1); MaskLayer *mask_layer = BKE_mask_layer_active(mask); if (mask_layer == NULL) { @@ -808,7 +809,7 @@ void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra } /* Local coordinate visible rect inside region, to accommodate overlapping ui. */ - const rcti *rect_visible = ED_region_visible_rect(ar); + const rcti *rect_visible = ED_region_visible_rect(region); const int region_bottom = rect_visible->ymin; uint pos = GPU_vertformat_attr_add( |