]> granicus.if.org Git - libass/commitdiff
Fix x coordinates with PAR correction and left border
authorGrigori Goronzy <greg@blackbox>
Mon, 29 Aug 2011 18:58:14 +0000 (20:58 +0200)
committerGrigori Goronzy <greg@blackbox>
Mon, 29 Aug 2011 18:59:29 +0000 (20:59 +0200)
This is a bit hacky, but I'm planning to rewrite positioning in a
much cleaner way. Addresses GC issue #27.

libass/ass_render.c

index d719e095b307970701b2ec7e54c23389fc53b724..603ec15448b18e520b718f9665e7cacae8fa644e 100644 (file)
@@ -2129,7 +2129,8 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
     }
 
     // convert glyphs to bitmaps
-    device_x *= render_priv->font_scale_x;
+    int left = render_priv->settings.left_margin;
+    device_x = (device_x - left) * render_priv->font_scale_x + left;
     for (i = 0; i < text_info->length; ++i) {
         GlyphInfo *info = glyphs + i;
         while (info) {