diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index d5714c152a3..4f24911b8f2 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1949,8 +1949,8 @@ static bool widget_draw_text_underline_calc_position(const char *UNUSED(str), /* Full width of this glyph including both bearings. */ const float width = glyph_bounds->xmin + BLI_rctf_size_x(glyph_bounds) + glyph_bounds->xmin; ul_data->r_offset_px[0] = glyph_step_bounds->xmin + ((width - ul_data->width_px) * 0.5f); - /* Two line-widths below the lower glyph bounds. */ - ul_data->r_offset_px[1] = glyph_bounds->ymin - U.pixelsize - U.pixelsize; + /* One line-width below the lower glyph bounds. */ + ul_data->r_offset_px[1] = glyph_bounds->ymin - U.pixelsize; /* Early exit. */ return false; } @@ -2221,16 +2221,13 @@ static void widget_draw_text(const uiFontStyle *fstyle, widget_draw_text_underline_calc_position, &ul_data); - GPU_blend(GPU_BLEND_ALPHA); - const uint pos = GPU_vertformat_attr_add( - immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - immUniformColor4ubv(wcol->text); const int pos_x = rect->xmin + font_xofs + ul_data.r_offset_px[0]; const int pos_y = rect->ymin + font_yofs + ul_data.r_offset_px[1]; - immRecti(pos, pos_x, pos_y, pos_x + ul_width, pos_y - ul_height); - immUnbindProgram(); - GPU_blend(GPU_BLEND_NONE); + + /* Use text output because direct drawing doesn't always work. See T89246. */ + BLF_position(fstyle->uifont_id, pos_x, pos_y, 0.0f); + BLF_color4ubv(fstyle->uifont_id, wcol->text); + BLF_draw(fstyle->uifont_id, "_", 2); if (fstyle->kerning == 1) { BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT); |