diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-10-29 18:49:27 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-10-29 18:51:55 +0300 |
commit | 87ac3d14b29d61d74b9aee2296f5b9892e2aa4a0 (patch) | |
tree | de71a6de84c517837a9107253858f85018a4dfd5 /source/blender/editors/space_image/image_draw.c | |
parent | aa841e2bd53bf9ed19f4902a36e6a9b483602bea (diff) |
Fix T70905: Image Editor header hides mask, cache and keyframe info if
flipped to bottom
While flipping the header to bottom works in the MCE (because MCE doesnt
allow overlapping UI) we need to take the regions visible rect into
account for the Image Editor.
Also correct clickable scubbing area (poll for frame_change) in the
Image Editor and the MovieClip Editor not taking UI_DPI_FAC into
account.
Maniphest Tasks: T70905
Differential Revision: https://developer.blender.org/D6090
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 9a2b0d95c20..2d4ca6dc15a 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -901,6 +901,10 @@ void draw_image_cache(const bContext *C, ARegion *ar) mask = ED_space_image_get_mask(sima); } + /* Local coordinate visible rect inside region, to accommodate overlapping ui. */ + const rcti *rect_visible = ED_region_visible_rect(ar); + const int region_bottom = rect_visible->ymin; + GPU_blend(true); GPU_blend_set_func_separate( GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); @@ -928,10 +932,10 @@ void draw_image_cache(const bContext *C, ARegion *ar) immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_CFRAME); - immRecti(pos, x, 0, x + ceilf(framelen), 8 * UI_DPI_FAC); + immRecti(pos, x, region_bottom, x + ceilf(framelen), region_bottom + 8 * UI_DPI_FAC); immUnbindProgram(); - ED_region_cache_draw_curfra_label(cfra, x, 8.0f * UI_DPI_FAC); + ED_region_cache_draw_curfra_label(cfra, x, region_bottom + 8.0f * UI_DPI_FAC); if (mask != NULL) { ED_mask_draw_frames(mask, ar, cfra, sfra, efra); |