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:
authorCampbell Barton <ideasman42@gmail.com>2015-09-19 07:50:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-19 08:22:03 +0300
commite6a413b1ec354dce94c4a42040d15a3191720de4 (patch)
tree22f4b9c435e8eb75393fd17d434e01dbf8852e8a /source/blender
parent36d64240e6898a5372a072f36a9ef30152e260fc (diff)
UI: word-wrap for tooltips, broke text alignment
This wasn't visible with default settings, but caused problems w/ pie-menu's & manually adjusted theme font-size. Now only draw from the bound-box top w/ word-wrap enabled.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_style.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 5d0d82e3b1e..25a187c43ad 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -172,7 +172,14 @@ void UI_fontstyle_draw_ex(
BLF_enable(fs->uifont_id, font_flag);
- yofs = BLI_rcti_size_y(rect) - BLF_height_max(fs->uifont_id);
+ if (fs->word_wrap == 1) {
+ /* draw from boundbox top */
+ yofs = BLI_rcti_size_y(rect) - BLF_height_max(fs->uifont_id);
+ }
+ else {
+ /* draw from boundbox center */
+ yofs = ceil(0.5f * (BLI_rcti_size_y(rect) - BLF_ascender(fs->uifont_id)));
+ }
if (fs->align == UI_STYLE_TEXT_CENTER) {
xofs = floor(0.5f * (BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len)));