]> granicus.if.org Git - libass/commitdiff
Fix subpixel jumping of rotated glyph runs
authorOleg Oshmyan <chortos@inbox.lv>
Wed, 29 Jan 2014 20:54:45 +0000 (20:54 +0000)
committerOleg Oshmyan <chortos@inbox.lv>
Wed, 29 Jan 2014 21:27:17 +0000 (21:27 +0000)
Rotation origin was not taken into account
when caching glyph run bitmaps.

libass/ass_cache_template.h
libass/ass_render.c
libass/ass_render.h

index 8f7f2af2f405f9716532f5435d3d313d14e7ff48..c91c8977246f697b8c2838cd98ac9369b29b5a2b 100644 (file)
@@ -149,6 +149,8 @@ START(composite, composite_hash_key)
     GENERIC(unsigned, bold)
     GENERIC(int, flags)
     GENERIC(unsigned, has_outline)
+    GENERIC(int, shift_x)
+    GENERIC(int, shift_y)
     FTVECTOR(advance)
     STRING(str)
 END(CompositeHashKey)
index d299f1bcc9a46db495a8c24fbec6e8079e8cf327..e629fddd9fcc69c682f5dd2e2b53a8bfe37a4a0f 100644 (file)
@@ -1020,6 +1020,8 @@ static void fill_composite_hash(CompositeHashKey *hk, CombinedBitmapInfo *info)
     hk->frz = info->frz;
     hk->fax = info->fax;
     hk->fay = info->fay;
+    hk->shift_x = info->shift_x;
+    hk->shift_y = info->shift_y;
     hk->advance = info->advance;
 }
 
@@ -2334,7 +2336,9 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
                 current_info->bold = info->bold;
                 current_info->flags = info->flags;
 
-                current_info->advance = info->hash_key.u.outline.advance;
+                current_info->shift_x = key->shift_x;
+                current_info->shift_y = key->shift_y;
+                current_info->advance = key->advance;
 
                 current_info->has_border = !!info->border;
 
index 6552aeba53afbd0a9ddba26218d6861cf7b2794f..7b3b6d743f10f35b517cb96e659908db50672fd0 100644 (file)
@@ -135,6 +135,7 @@ typedef struct {
     unsigned italic;
     unsigned bold;
     int flags;
+    int shift_x, shift_y;
 
     unsigned has_outline;
     unsigned is_drawing;