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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-16 13:37:15 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-16 13:37:15 +0400
commite114459ba36276aed5f3e04d99e7c8556a3e206b (patch)
treecf95a206a82b58351304c7c8b36b0f37f9322eb2 /source/blender/editors/screen
parent9a469b62cabf3d434de68c9e698970cc7f060136 (diff)
Fix region overlap drawing over render info text in image editor and 3d view.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/area.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index a73c2d818d0..932414ffaba 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1852,7 +1852,7 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
/* text */
UI_ThemeColor(TH_TEXT_HI);
- BLF_position(fontid, 12, rect.ymin + 5, 0.0f);
+ BLF_position(fontid, 12 + ED_region_overlapping_offset(ar), rect.ymin + 5, 0.0f);
BLF_draw(fontid, text, BLF_DRAW_STR_DUMMY_MAX);
}
@@ -1915,3 +1915,23 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
}
glEnd();
}
+
+/* checks overlapping region for labels, axes, icons */
+int ED_region_overlapping_offset(ARegion *ar)
+{
+ ARegion *arn = ar;
+
+ /* too lazy to pass on area listbase */
+ while (arn->prev)
+ arn = arn->prev;
+
+ /* check if a region overlaps with the current one */
+ for (; arn; arn = arn->next) {
+ if (ar != arn)
+ if (ar->winrct.xmin == arn->winrct.xmin)
+ if (ar->winrct.ymin == arn->winrct.ymin)
+ return arn->winrct.xmax - arn->winrct.xmin;
+ }
+ return 0;
+}
+