diff --git a/src/draw.c b/src/draw.c index 3edfd85..e2760e5 100644 --- a/src/draw.c +++ b/src/draw.c @@ -790,11 +790,22 @@ void gfx_copy_stretch_with_alpha_map(Texture *dst, int dx, int dy, int dw, int d // XXX: Not an actual DrawGraph function; used for rendering text void gfx_draw_glyph(Texture *dst, float dx, int dy, Texture *glyph, SDL_Color color, float scale_x, float bold_width) { + dx = roundf(dx); + + glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ZERO, GL_ONE); + struct copy_data fill_data = COPY_DATA(dx, dy, dx, dy, glyph->w * scale_x, glyph->h); + fill_data.r = color.r / 255.0; + fill_data.g = color.g / 255.0; + fill_data.b = color.b / 255.0; + fill_data.a = 0.0; + fill_data.threshold = 0.001; + run_copy_shader(&fill_amap_under_border_shader.s, dst, dst, &fill_data); + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); struct copy_data data = STRETCH_DATA( - roundf(dx), dy, glyph->w * scale_x, glyph->h, - 0, 0, glyph->w, glyph->h); + dx, dy, glyph->w * scale_x, glyph->h, + 0, 0, glyph->w, glyph->h); data.r = color.r / 255.0; data.g = color.g / 255.0; data.b = color.b / 255.0;