Cleanup: pass pointer to rctf
This commit is contained in:
@@ -69,7 +69,7 @@ void ED_region_header_init(struct ARegion *ar);
|
||||
void ED_region_header(const struct bContext *C, struct ARegion *ar);
|
||||
void ED_region_toggle_hidden(struct bContext *C, struct ARegion *ar);
|
||||
void ED_region_info_draw(struct ARegion *ar, const char *text, float fill_color[4], const bool full_redraw);
|
||||
void ED_region_image_metadata_draw(int x, int y, struct ImBuf *ibuf, rctf frame, float zoomx, float zoomy);
|
||||
void ED_region_image_metadata_draw(int x, int y, struct ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy);
|
||||
void ED_region_grid_draw(struct ARegion *ar, float zoomx, float zoomy);
|
||||
float ED_region_blend_factor(struct ARegion *ar);
|
||||
void ED_region_visible_rect(struct ARegion *ar, struct rcti *rect);
|
||||
|
@@ -2202,7 +2202,7 @@ static float metadata_box_height_get(ImBuf *ibuf, int fontid, const bool is_top)
|
||||
|
||||
#undef MAX_METADATA_STR
|
||||
|
||||
void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, rctf frame, float zoomx, float zoomy)
|
||||
void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
|
||||
{
|
||||
float box_y;
|
||||
rctf rect;
|
||||
@@ -2229,7 +2229,7 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, rctf frame, float
|
||||
UI_ThemeColor(TH_METADATA_BG);
|
||||
|
||||
/* set up rect */
|
||||
BLI_rctf_init(&rect, frame.xmin, frame.xmax, frame.ymax, frame.ymax + box_y);
|
||||
BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymax, frame->ymax + box_y);
|
||||
/* draw top box */
|
||||
glRectf(rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
||||
|
||||
@@ -2251,7 +2251,7 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, rctf frame, float
|
||||
UI_ThemeColor(TH_METADATA_BG);
|
||||
|
||||
/* set up box rect */
|
||||
BLI_rctf_init(&rect, frame.xmin, frame.xmax, frame.ymin - box_y, frame.ymin);
|
||||
BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymin - box_y, frame->ymin);
|
||||
/* draw top box */
|
||||
glRectf(rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
||||
|
||||
|
@@ -286,7 +286,6 @@ static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar,
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
int filter = GL_LINEAR;
|
||||
int x, y;
|
||||
rctf frame;
|
||||
|
||||
/* find window pixel coordinates of origin */
|
||||
UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x, &y);
|
||||
@@ -313,10 +312,12 @@ static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar,
|
||||
/* reset zoom */
|
||||
glPixelZoom(1.0f, 1.0f);
|
||||
|
||||
BLI_rctf_init(&frame, 0.0f, ibuf->x, 0.0f, ibuf->y);
|
||||
|
||||
if (sc->flag & SC_SHOW_METADATA)
|
||||
ED_region_image_metadata_draw(x, y, ibuf, frame, zoomx * width / ibuf->x, zoomy * height / ibuf->y);
|
||||
if (sc->flag & SC_SHOW_METADATA) {
|
||||
rctf frame;
|
||||
BLI_rctf_init(&frame, 0.0f, ibuf->x, 0.0f, ibuf->y);
|
||||
ED_region_image_metadata_draw(x, y, ibuf, &frame, zoomx * width / ibuf->x, zoomy * height / ibuf->y);
|
||||
}
|
||||
|
||||
if (ibuf->planes == 32)
|
||||
glDisable(GL_BLEND);
|
||||
|
@@ -855,7 +855,7 @@ void draw_image_main(const bContext *C, ARegion *ar)
|
||||
BLI_rctf_init(&frame, 0.0f, ibuf->x, 0.0f, ibuf->y);
|
||||
UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x, &y);
|
||||
|
||||
ED_region_image_metadata_draw(x, y, ibuf, frame, zoomx, zoomy);
|
||||
ED_region_image_metadata_draw(x, y, ibuf, &frame, zoomx, zoomy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1362,7 +1362,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
|
||||
IMB_freeImBuf(ibuf);
|
||||
|
||||
if (draw_metadata) {
|
||||
ED_region_image_metadata_draw(0.0, 0.0, ibuf, v2d->tot, 1.0, 1.0);
|
||||
ED_region_image_metadata_draw(0.0, 0.0, ibuf, &v2d->tot, 1.0, 1.0);
|
||||
}
|
||||
|
||||
if (draw_backdrop) {
|
||||
|
Reference in New Issue
Block a user