diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-15 15:48:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-15 15:48:20 +0400 |
commit | 232571c61a0120e71d980e47351d0656475dcbb5 (patch) | |
tree | 1980460d86e5743306ce676f28c5feb399248469 /source/blender/editors/space_sequencer | |
parent | 219b748dfc556d9920434fc67a9d0e980e8e7fab (diff) |
code cleanup: replace macro for BLI_rect size/center with inline functions.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 14 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 20 |
2 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 7363bf2fbd8..f927e83cabe 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -432,7 +432,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq) y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; y2 = seq->machine + SEQ_STRIP_OFSTOP; - pixely = BLI_RCT_SIZE_Y(&v2d->cur) / BLI_RCT_SIZE_Y(&v2d->mask); + pixely = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask); if (pixely <= 0) return; /* can happen when the view is split/resized */ @@ -725,7 +725,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline /* draw sound wave */ if (seq->type == SEQ_TYPE_SOUND_RAM) { - drawseqwave(scene, seq, x1, y1, x2, y2, BLI_RCT_SIZE_X(&ar->v2d.cur) / ar->winx); + drawseqwave(scene, seq, x1, y1, x2, y2, BLI_rctf_size_x(&ar->v2d.cur) / ar->winx); } /* draw lock */ @@ -1032,10 +1032,10 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq if (draw_overlay) { if (sseq->overlay_type == SEQ_DRAW_OVERLAY_RECT) { rctf tot_clip; - tot_clip.xmin = v2d->tot.xmin + (ABS(BLI_RCT_SIZE_X(&v2d->tot)) * scene->ed->over_border.xmin); - tot_clip.ymin = v2d->tot.ymin + (ABS(BLI_RCT_SIZE_Y(&v2d->tot)) * scene->ed->over_border.ymin); - tot_clip.xmax = v2d->tot.xmin + (ABS(BLI_RCT_SIZE_X(&v2d->tot)) * scene->ed->over_border.xmax); - tot_clip.ymax = v2d->tot.ymin + (ABS(BLI_RCT_SIZE_Y(&v2d->tot)) * scene->ed->over_border.ymax); + tot_clip.xmin = v2d->tot.xmin + (fabsf(BLI_rctf_size_x(&v2d->tot)) * scene->ed->over_border.xmin); + tot_clip.ymin = v2d->tot.ymin + (fabsf(BLI_rctf_size_y(&v2d->tot)) * scene->ed->over_border.ymin); + tot_clip.xmax = v2d->tot.xmin + (fabsf(BLI_rctf_size_x(&v2d->tot)) * scene->ed->over_border.xmax); + tot_clip.ymax = v2d->tot.ymin + (fabsf(BLI_rctf_size_y(&v2d->tot)) * scene->ed->over_border.ymax); glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin); glVertex2f(tot_clip.xmin, tot_clip.ymin); glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax); glVertex2f(tot_clip.xmin, tot_clip.ymax); @@ -1222,7 +1222,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) View2D *v2d = &ar->v2d; Sequence *last_seq = BKE_sequencer_active_get(scene); int sel = 0, j; - float pixelx = BLI_RCT_SIZE_X(&v2d->cur) / BLI_RCT_SIZE_X(&v2d->mask); + float pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); /* loop through twice, first unselected, then selected */ for (j = 0; j < 2; j++) { diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index f47eb339878..e7d964ba715 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -372,7 +372,7 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[ if (ed == NULL) return NULL; - pixelx = BLI_RCT_SIZE_X(&v2d->cur) / BLI_RCT_SIZE_X(&v2d->mask); + pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); @@ -2164,8 +2164,8 @@ static int sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op) float winx = (int)(rd->size * rd->xsch) / 100; float winy = (int)(rd->size * rd->ysch) / 100; - float facx = BLI_RCT_SIZE_X(&v2d->mask) / winx; - float facy = BLI_RCT_SIZE_Y(&v2d->mask) / winy; + float facx = BLI_rcti_size_x(&v2d->mask) / winx; + float facy = BLI_rcti_size_y(&v2d->mask) / winy; BLI_rctf_resize(&v2d->cur, (int)(winx * facx * ratio) + 1, (int)(winy * facy * ratio) + 1); @@ -2268,7 +2268,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) ymax += ymargin; ymin -= ymargin; - orig_height = BLI_RCT_SIZE_Y(&cur_new); + orig_height = BLI_rctf_size_y(&cur_new); cur_new.xmin = xmin; cur_new.xmax = xmax; @@ -2277,8 +2277,8 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) cur_new.ymax = ymax; /* only zoom out vertically */ - if (orig_height > BLI_RCT_SIZE_Y(&cur_new)) { - ymid = BLI_RCT_CENTER_Y(&cur_new); + if (orig_height > BLI_rctf_size_y(&cur_new)) { + ymid = BLI_rctf_cent_y(&cur_new); cur_new.ymin = ymid - (orig_height / 2); cur_new.ymax = ymid + (orig_height / 2); @@ -2800,11 +2800,11 @@ static int view_ghost_border_exec(bContext *C, wmOperator *op) if (ed == NULL) return OPERATOR_CANCELLED; - rect.xmin /= (float)(ABS(BLI_RCT_SIZE_X(&v2d->tot))); - rect.ymin /= (float)(ABS(BLI_RCT_SIZE_Y(&v2d->tot))); + rect.xmin /= fabsf(BLI_rctf_size_x(&v2d->tot)); + rect.ymin /= fabsf(BLI_rctf_size_y(&v2d->tot)); - rect.xmax /= (float)(ABS(BLI_RCT_SIZE_X(&v2d->tot))); - rect.ymax /= (float)(ABS(BLI_RCT_SIZE_Y(&v2d->tot))); + rect.xmax /= fabsf(BLI_rctf_size_x(&v2d->tot)); + rect.ymax /= fabsf(BLI_rctf_size_y(&v2d->tot)); rect.xmin += 0.5f; rect.xmax += 0.5f; |