[Bf-blender-cvs] [6c513dc3e47] master: Fix T62190: Image editor pixel values are hidden by header at the bottom
Philipp Oeser
noreply at git.blender.org
Tue Mar 5 11:25:28 CET 2019
Commit: 6c513dc3e47d9944ac552f48d6bb0c16dd208074
Author: Philipp Oeser
Date: Tue Mar 5 10:39:42 2019 +0100
Branches: master
https://developer.blender.org/rB6c513dc3e47d9944ac552f48d6bb0c16dd208074
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
===================================================================
M source/blender/editors/space_image/image_draw.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list