From bb5319c7dc0c91815750eafe771303f5fffbe30b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 4 Jul 2025 10:32:22 +0200 Subject: Make shadow offset proportional to the target size. Otherwise it looks further away in the preview than in in the final DCP (if the preview is smaller). --- src/lib/render_text.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/render_text.cc') diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 80c6614e9..4ce98949b 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -409,6 +409,7 @@ render_line(vector subtitles, dcp::Size target, DCPTime time, int fr auto const border_width = border_width_for_subtitle(first, target); layout.size.width += 2 * ceil(border_width); layout.size.height += 2 * ceil(border_width); + auto const shadow_offset = dcp_pixels_to_pixels(target, 4); layout.size.width *= x_scale; layout.size.height *= y_scale; @@ -428,7 +429,7 @@ render_line(vector subtitles, dcp::Size target, DCPTime time, int fr if (first.effect() == dcp::Effect::SHADOW) { /* Drop-shadow effect */ set_source_rgba(context, first.effect_colour(), fade_factor); - context->move_to(x_offset + 4, y_offset + 4); + context->move_to(x_offset + shadow_offset, y_offset + shadow_offset); layout.pango->add_to_cairo_context(context); context->fill(); } -- cgit v1.2.3