[Bf-blender-cvs] [733250f] temp-blf-wordwrap: scale the tooltip width with the zoom-level
Campbell Barton
noreply at git.blender.org
Sat Aug 29 19:40:58 CEST 2015
Commit: 733250fd2dbc15e09d604d70ec46359f2110bdc1
Author: Campbell Barton
Date: Sun Aug 30 02:30:42 2015 +1000
Branches: temp-blf-wordwrap
https://developer.blender.org/rB733250fd2dbc15e09d604d70ec46359f2110bdc1
scale the tooltip width with the zoom-level
===================================================================
M source/blender/editors/interface/interface_regions.c
===================================================================
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index d7064d3..16b8634 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -148,7 +148,7 @@ static void ui_region_temp_remove(bContext *C, bScreen *sc, ARegion *ar)
#define UI_TIP_PAD_FAC 1.3f
#define UI_TIP_PADDING (int)(UI_TIP_PAD_FAC * UI_UNIT_Y)
-#define UI_TIP_MAXWIDTH 800
+#define UI_TIP_MAXWIDTH 600
#define MAX_TOOLTIP_LINES 8
typedef struct uiTooltipData {
@@ -588,7 +588,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
UI_fontstyle_set(&data->fstyle);
- data->wrap_width = min_ii(UI_TIP_MAXWIDTH * U.pixelsize, WM_window_pixels_x(win) - (UI_TIP_PADDING * 2));
+ data->wrap_width = min_ii(UI_TIP_MAXWIDTH * U.pixelsize / aspect, WM_window_pixels_x(win) - (UI_TIP_PADDING * 2));
font_flag |= BLF_WORDWRAP;
if (data->fstyle.kerning == 1) {
More information about the Bf-blender-cvs
mailing list