[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54044] trunk/blender/source/blender/ editors/screen/area.c: Fix #33556: overlapping regions draw over render info at the top of 3d view and
Brecht Van Lommel
brechtvanlommel at pandora.be
Wed Jan 23 15:05:11 CET 2013
Revision: 54044
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54044
Author: blendix
Date: 2013-01-23 14:05:08 +0000 (Wed, 23 Jan 2013)
Log Message:
-----------
Fix #33556: overlapping regions draw over render info at the top of 3d view and
image editor. Also fix it not scaling properly with DPI.
Modified Paths:
--------------
trunk/blender/source/blender/editors/screen/area.c
Modified: trunk/blender/source/blender/editors/screen/area.c
===================================================================
--- trunk/blender/source/blender/editors/screen/area.c 2013-01-23 13:45:52 UTC (rev 54043)
+++ trunk/blender/source/blender/editors/screen/area.c 2013-01-23 14:05:08 UTC (rev 54044)
@@ -1864,15 +1864,11 @@
/* background box */
ED_region_visible_rect(ar, &rect);
- rect.xmin = 0;
rect.ymin = BLI_rcti_size_y(&ar->winrct) - header_height;
- if (block) {
- rect.xmax = BLI_rcti_size_x(&ar->winrct);
- }
- else {
- rect.xmax = rect.xmin + BLF_width(fontid, text) + 24;
- }
+ /* box fill entire width or just around text */
+ if (!block)
+ rect.xmax = min_ii(rect.xmax, rect.xmin + BLF_width(fontid, text) + 1.2f * U.widget_unit);
rect.ymax = BLI_rcti_size_y(&ar->winrct);
@@ -1884,8 +1880,13 @@
/* text */
UI_ThemeColor(TH_TEXT_HI);
- BLF_position(fontid, 12, rect.ymin + 5, 0.0f);
+ BLF_clipping(fontid, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+ BLF_enable(fontid, BLF_CLIPPING);
+ BLF_position(fontid, rect.xmin + 0.6f * U.widget_unit, rect.ymin + 0.3f*U.widget_unit, 0.0f);
+
BLF_draw(fontid, text, BLF_DRAW_STR_DUMMY_MAX);
+
+ BLF_disable(fontid, BLF_CLIPPING);
}
void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
More information about the Bf-blender-cvs
mailing list