Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2019-10-29 18:49:27 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-10-29 18:51:55 +0300
commit87ac3d14b29d61d74b9aee2296f5b9892e2aa4a0 (patch)
treede71a6de84c517837a9107253858f85018a4dfd5 /source/blender/editors/screen/area.c
parentaa841e2bd53bf9ed19f4902a36e6a9b483602bea (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/screen/area.c')
-rw-r--r--source/blender/editors/screen/area.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index c068fbdf7cb..bf45fa24923 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -3337,13 +3337,17 @@ const rcti *ED_region_visible_rect(ARegion *ar)
/* Cache display helpers */
-void ED_region_cache_draw_background(const ARegion *ar)
+void ED_region_cache_draw_background(ARegion *ar)
{
+ /* 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;
+
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4ub(128, 128, 255, 64);
- immRecti(pos, 0, 0, ar->winx, 8 * UI_DPI_FAC);
+ immRecti(pos, 0, region_bottom, ar->winx, region_bottom + 8 * UI_DPI_FAC);
immUnbindProgram();
}
@@ -3373,9 +3377,13 @@ void ED_region_cache_draw_curfra_label(const int framenr, const float x, const f
}
void ED_region_cache_draw_cached_segments(
- const ARegion *ar, const int num_segments, const int *points, const int sfra, const int efra)
+ ARegion *ar, const int num_segments, const int *points, const int sfra, const int efra)
{
if (num_segments) {
+ /* 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;
+
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -3385,7 +3393,7 @@ void ED_region_cache_draw_cached_segments(
float x1 = (float)(points[a * 2] - sfra) / (efra - sfra + 1) * ar->winx;
float x2 = (float)(points[a * 2 + 1] - sfra + 1) / (efra - sfra + 1) * ar->winx;
- immRecti(pos, x1, 0, x2, 8 * UI_DPI_FAC);
+ immRecti(pos, x1, region_bottom, x2, region_bottom + 8 * UI_DPI_FAC);
/* TODO(merwin): use primitive restart to draw multiple rects more efficiently */
}