Fix #19427, problem in blenfont not computing the width of text correct,
[blender.git] / source / blender / blenfont / intern / blf_font.c
index 0a3dd259f6c4585acdeb066b8128d0b2d7709fa2..8721e49f06b23b53d537ac538f0713db05644411 100644 (file)
@@ -353,8 +353,8 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
                                pen_x += delta.x >> 6;
                }
 
-               gbox.xmin= g->box.xmin + pen_x;
-               gbox.xmax= g->box.xmax + pen_x;
+               gbox.xmin= pen_x;
+               gbox.xmax= pen_x + g->advance;
                gbox.ymin= g->box.ymin + pen_y;
                gbox.ymax= g->box.ymax + pen_y;