Fix pango markup with alpha blending.
authorCarl Hetherington <cth@carlh.net>
Wed, 14 Dec 2016 12:44:48 +0000 (12:44 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 14 Dec 2016 12:44:48 +0000 (12:44 +0000)
src/lib/render_subtitles.cc

index fa1cf4766906e3e48840e79a94081d6d4d1a6be0..1984d9c670b2fd4d529d0595579071d2f42cefab 100644 (file)
@@ -65,7 +65,8 @@ marked_up (list<SubtitleString> subtitles, int target_height, float fade_factor)
                        out += "underline=\"single\" ";
                }
                out += "size=\"" + dcp::raw_convert<string>(i.size_in_pixels(target_height) * 72 * 1024 / 96) + "\" ";
-               out += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65535))) + "\" ";
+               /* Between 1-65535 inclusive, apparently... */
+               out += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65534)) + 1) + "\" ";
                out += "color=\"#" + i.colour().to_rgb_string() + "\">";
                out += i.text ();
                out += "</span>";