diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-07-04 10:29:16 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-07-08 22:11:35 +0200 |
| commit | 57a83f853fc45be5361ec002acc964c1ed8b89b4 (patch) | |
| tree | 1cc1b4d462a8b386970a4cab135e476dbbb35c3e | |
| parent | 3f8df1be4983cc1ce7547d9bbb89114bf281d9b7 (diff) | |
Add dcp_pixels_to_pixels().
| -rw-r--r-- | src/lib/render_text.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index b2384871f..80c6614e9 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -361,9 +361,17 @@ setup_layout(vector<StringText> subtitles, dcp::Size target, DCPTime time, int f static float +dcp_pixels_to_pixels(dcp::Size target, int pixels) +{ + return pixels * target.width / 2048.0; +} + + +static +float border_width_for_subtitle(StringText const& subtitle, dcp::Size target) { - return subtitle.effect() == dcp::Effect::BORDER ? (subtitle.outline_width * target.width / 2048.0) : 0; + return subtitle.effect() == dcp::Effect::BORDER ? dcp_pixels_to_pixels(target, subtitle.outline_width) : 0; } |
