Skip to content

Commit

Permalink
Fix garbled subtitles when using Freetype
Browse files Browse the repository at this point in the history
Fixes #190
  • Loading branch information
jcdr428 authored Feb 21, 2020
1 parent 54f59df commit a664fdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tsMuxer/osdep/textSubtitlesRenderFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ void RenderGlyph(FT_Library& library, wchar_t ch, FT_Face& face, int size, const
for (int w = 0; w < s->width; ++w)
{
int y = imgHeight - 1 - (s->y - rect.ymin) + top;
int x = s->x + w;
int x = s->x + w + left;
if (y >= 0 && y < height && x >= 0 && x < width)
{
Pixel32* dst = (Pixel32*)dstData + y * width + x;
Expand All @@ -469,7 +469,7 @@ void RenderGlyph(FT_Library& library, wchar_t ch, FT_Face& face, int size, const
for (int w = 0; w < s->width; ++w)
{
int y = imgHeight - 1 - (s->y - rect.ymin) + top;
int x = s->x + w;
int x = s->x + w + left;
if (y >= 0 && y < height && x >= 0 && x < width)
{
Pixel32* dst = (Pixel32*)dstData + y * width + x;
Expand All @@ -484,7 +484,7 @@ void RenderGlyph(FT_Library& library, wchar_t ch, FT_Face& face, int size, const
for (int w = 0; w < s->width; ++w)
{
int y = imgHeight - 1 - (s->y - rect.ymin) + top;
int x = s->x + w;
int x = s->x + w + left;

if (y >= 0 && y < height && x >= 0 && x < width)
{
Expand Down

0 comments on commit a664fdc

Please sign in to comment.