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-03-05 12:39:42 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-03-05 13:19:39 +0300
commit6c513dc3e47d9944ac552f48d6bb0c16dd208074 (patch)
treece6d08b1be1f792561d986a22a2405e394435168 /source/blender/editors/space_image/image_draw.c
parent3e4cf413ea7cc20daf2d3f67af9ccc6f47b3130e (diff)
Fix T62190: Image editor pixel values are hidden by header at the bottom
since header regions can possibly overlap, accommodate by getting main regions visible rect first. Reviewers: sergey, brecht Maniphest Tasks: T62190 Differential Revision: https://developer.blender.org/D4449
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r--source/blender/editors/space_image/image_draw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 760068d9641..d50df324db0 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -149,7 +149,12 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, bool color_manage, bool use_d
rcti color_rect;
char str[256];
int dx = 6;
- const int dy = 0.3f * UI_UNIT_Y;
+ /* local coordinate visible rect inside region, to accommodate overlapping ui */
+ rcti rect;
+ ED_region_visible_rect(ar, &rect);
+ const int ymin = rect.ymin;
+ const int dy = ymin + 0.3f * UI_UNIT_Y;
+
/* text colors */
/* XXX colored text not allowed in Blender UI */
#if 0
@@ -172,7 +177,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, bool color_manage, bool use_d
/* noisy, high contrast make impossible to read if lower alpha is used. */
immUniformColor4ub(0, 0, 0, 190);
- immRecti(pos, 0, 0, BLI_rcti_size_x(&ar->winrct) + 1, UI_UNIT_Y);
+ immRecti(pos, 0, ymin, BLI_rcti_size_x(&ar->winrct) + 1, ymin + UI_UNIT_Y);
immUnbindProgram();
@@ -320,7 +325,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, bool color_manage, bool use_d
GPU_blend(false);
dx += 0.25f * UI_UNIT_X;
- BLI_rcti_init(&color_rect, dx, dx + (1.5f * UI_UNIT_X), 0.15f * UI_UNIT_Y, 0.85f * UI_UNIT_Y);
+ BLI_rcti_init(&color_rect, dx, dx + (1.5f * UI_UNIT_X), ymin + 0.15f * UI_UNIT_Y, ymin + 0.85f * UI_UNIT_Y);
/* BLF uses immediate mode too, so we must reset our vertex format */
pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);