Slightly hacky fix for negative padding in Scope, causing corrupt images.
authorCarl Hetherington <cth@carlh.net>
Thu, 9 Aug 2012 11:56:36 +0000 (12:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 9 Aug 2012 11:56:36 +0000 (12:56 +0100)
src/lib/format.cc

index dcc884412487a6e2fb80fef205ac949c671e37cb..d99ed926a2ac42df20ed7216c716bb9a91256ddd 100644 (file)
@@ -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;
 }