diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-20 07:48:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-20 07:50:20 +0300 |
commit | 289960787ea70b1d1acd528bee71e8f8439bf369 (patch) | |
tree | d6479b09269c5e22f9a2cfa3086205a378a9019c /source/blender/editors/interface/interface_eyedropper.c | |
parent | 09eec627ed730532905b45d409f9009023623437 (diff) |
Fix UI glitches drawing text at different sizes
Font height was ignoring DPI in some cases (camera-name & eyedropper).
Diffstat (limited to 'source/blender/editors/interface/interface_eyedropper.c')
-rw-r--r-- | source/blender/editors/interface/interface_eyedropper.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c index dfcafd7e46e..ec1234a82be 100644 --- a/source/blender/editors/interface/interface_eyedropper.c +++ b/source/blender/editors/interface/interface_eyedropper.c @@ -77,7 +77,9 @@ static void eyedropper_draw_cursor_text(const struct bContext *C, ARegion *ar, c wmWindow *win = CTX_wm_window(C); int x = win->eventstate->x; int y = win->eventstate->y; - int width; + const unsigned char fg[4] = {255, 255, 255, 255}; + const unsigned char bg[4] = {0, 0, 0, 50}; + if ((name[0] == '\0') || (BLI_rcti_isect_pt(&ar->winrct, x, y) == false)) @@ -85,19 +87,12 @@ static void eyedropper_draw_cursor_text(const struct bContext *C, ARegion *ar, c return; } - width = UI_fontstyle_string_width(fstyle, name); x = x - ar->winrct.xmin; y = y - ar->winrct.ymin; - y += 20; - - glColor4ub(0, 0, 0, 50); - - UI_draw_roundbox_corner_set(UI_CNR_ALL | UI_RB_ALPHA); - UI_draw_roundbox(x, y, x + width + 8, y + 15, 4); + y += U.widget_unit; - glColor4ub(255, 255, 255, 255); - UI_fontstyle_draw_simple(fstyle, x + 4, y + 4, name); + UI_fontstyle_draw_simple_backdrop(fstyle, x, y, name, fg, bg); } /** \} */ |