Cleanup: Use more common variable name

It's preferred to use `area` as a name for `ScrArea` variables.
This commit is contained in:
Hans Goudey 2021-12-25 14:57:07 -06:00
parent 85abac7e87
commit ceed8f7c06
2 changed files with 21 additions and 21 deletions

View File

@ -263,32 +263,32 @@ static bool eyedropper_cryptomatte_sample_fl(
}
bScreen *screen = CTX_wm_screen(C);
ScrArea *sa = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, (const int[2]){mx, my});
if (!sa || !ELEM(sa->spacetype, SPACE_IMAGE, SPACE_NODE, SPACE_CLIP)) {
ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, (const int[2]){mx, my});
if (!area || !ELEM(area->spacetype, SPACE_IMAGE, SPACE_NODE, SPACE_CLIP)) {
return false;
}
ARegion *region = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, (const int[2]){mx, my});
ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, (const int[2]){mx, my});
if (!region) {
return false;
}
int mval[2] = {mx - region->winrct.xmin, my - region->winrct.ymin};
float fpos[2] = {-1.0f, -1.0};
switch (sa->spacetype) {
switch (area->spacetype) {
case SPACE_IMAGE: {
SpaceImage *sima = sa->spacedata.first;
SpaceImage *sima = area->spacedata.first;
ED_space_image_get_position(sima, region, mval, fpos);
break;
}
case SPACE_NODE: {
Main *bmain = CTX_data_main(C);
SpaceNode *snode = sa->spacedata.first;
SpaceNode *snode = area->spacedata.first;
ED_space_node_get_position(bmain, snode, region, mval, fpos);
break;
}
case SPACE_CLIP: {
SpaceClip *sc = sa->spacedata.first;
SpaceClip *sc = area->spacedata.first;
ED_space_clip_get_position(sc, region, mval, fpos);
break;
}

View File

@ -278,13 +278,13 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event
/* XXX node curve integration. */
#if 0
{
ScrArea *sa, *cur = curarea;
ScrArea *area, *cur = curarea;
node_curvemap_sample(fp); /* sends global to node editor */
for (sa = G.curscreen->areabase.first; sa; sa = sa->next) {
if (sa->spacetype == SPACE_NODE) {
areawinset(sa->win);
scrarea_do_windraw(sa);
for (area = G.curscreen->areabase.first; area; area = area->next) {
if (area->spacetype == SPACE_NODE) {
areawinset(area->win);
scrarea_do_windraw(area);
}
}
node_curvemap_sample(NULL); /* clears global in node editor */
@ -385,12 +385,12 @@ static void sequencer_sample_apply(bContext *C, wmOperator *op, const wmEvent *e
static void ed_imbuf_sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
{
ScrArea *sa = CTX_wm_area(C);
if (sa == NULL) {
ScrArea *area = CTX_wm_area(C);
if (area == NULL) {
return;
}
switch (sa->spacetype) {
switch (area->spacetype) {
case SPACE_IMAGE: {
image_sample_apply(C, op, event);
break;
@ -432,9 +432,9 @@ void ED_imbuf_sample_draw(const bContext *C, ARegion *region, void *arg_info)
info->zfp);
if (info->sample_size > 1) {
ScrArea *sa = CTX_wm_area(C);
ScrArea *area = CTX_wm_area(C);
if (sa && sa->spacetype == SPACE_IMAGE) {
if (area && area->spacetype == SPACE_IMAGE) {
const wmWindow *win = CTX_wm_window(C);
const wmEvent *event = win->eventstate;
@ -482,11 +482,11 @@ void ED_imbuf_sample_exit(bContext *C, wmOperator *op)
int ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
ARegion *region = CTX_wm_region(C);
ScrArea *sa = CTX_wm_area(C);
if (sa) {
switch (sa->spacetype) {
ScrArea *area = CTX_wm_area(C);
if (area) {
switch (area->spacetype) {
case SPACE_IMAGE: {
SpaceImage *sima = sa->spacedata.first;
SpaceImage *sima = area->spacedata.first;
if (region->regiontype == RGN_TYPE_WINDOW) {
if (ED_space_image_show_cache_and_mval_over(sima, region, event->mval)) {
return OPERATOR_PASS_THROUGH;