diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/film.cc | 11 | ||||
| -rw-r--r-- | src/lib/format.cc | 9 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 259c3a606..65a75b845 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -165,7 +165,16 @@ Film::set_name (string n) void Film::set_content (string c) { - if (filesystem::path(c).has_root_directory () && starts_with (c, _state.directory)) { + string check = _state.directory; + + filesystem::path slash ("/"); + string platform_slash = slash.make_preferred().string (); + + if (!ends_with (check, platform_slash)) { + check += platform_slash; + } + + if (filesystem::path(c).has_root_directory () && starts_with (c, check)) { c = c.substr (_state.directory.length() + 1); } diff --git a/src/lib/format.cc b/src/lib/format.cc index dcc884412..d99ed926a 100644 --- a/src/lib/format.cc +++ b/src/lib/format.cc @@ -185,5 +185,12 @@ Format::all () int Format::dcp_padding () const { - return rint ((_dcp_size.width - (_dcp_size.height * _ratio / 100.0)) / 2.0); + int p = rint ((_dcp_size.width - (_dcp_size.height * _ratio / 100.0)) / 2.0); + + /* This comes out -ve for Scope; bodge it */ + if (p < 0) { + p = 0; + } + + return p; } |
