]> granicus.if.org Git - libass/commitdiff
Scale ascender/descender for opaque boxes
authorGrigori Goronzy <greg@dell>
Thu, 13 Aug 2009 15:25:56 +0000 (17:25 +0200)
committerGrigori Goronzy <greg@dell>
Thu, 13 Aug 2009 16:43:02 +0000 (18:43 +0200)
libass/ass_render.c

index b9125b8720e2ac729ccad150e272de0a1ef35df0..7922825e17a5671f2e024f65a781e48dfc714d73 100644 (file)
@@ -1896,6 +1896,7 @@ static void draw_opaque_box(ASS_Renderer *render_priv, uint32_t ch,
     int asc = 0, desc = 0;
     int i;
     int adv = d16_to_d6(glyph->advance.x);
+    double scale_y = render_priv->state.scale_y;
     FT_OutlineGlyph og = (FT_OutlineGlyph) glyph;
     FT_Outline *ol;
 
@@ -1904,6 +1905,9 @@ static void draw_opaque_box(ASS_Renderer *render_priv, uint32_t ch,
     sy = FFMAX(64, sy);
 
     ass_font_get_asc_desc(render_priv->state.font, ch, &asc, &desc);
+    asc  *= scale_y;
+    desc *= scale_y;
+
     FT_Vector points[4] = {
         { .x = -sx,         .y = asc + sy },
         { .x = adv + sx,    .y = asc + sy },