X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Frect.h;h=5f807f4999a155a8de737adc30eac87fe1a43d65;hb=a5f481aae19a6ef5b0cad48edaea5b58fc00ee05;hp=4851ad007fe11c6ce7b7469c2cb6f7367dd2eccd;hpb=565490c24a46d0aa941f75cf2a03b195246008b4;p=dcpomatic.git diff --git a/src/lib/rect.h b/src/lib/rect.h index 4851ad007..5f807f499 100644 --- a/src/lib/rect.h +++ b/src/lib/rect.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,22 @@ */ + #ifndef DCPOMATIC_RECT_H #define DCPOMATIC_RECT_H + #include "position.h" #include #include + /* Put this inside a namespace as Apple put a Rect in the global namespace */ namespace dcpomatic { + /** @struct Rect * @brief A rectangle. */ @@ -69,7 +73,7 @@ public: return Position (x, y); } - boost::optional > intersection (Rect const & other) const + boost::optional> intersection (Rect const & other) const { /* This isn't exactly the paragon of mathematical precision */ @@ -83,7 +87,7 @@ public: ); if (r.width < 0 || r.height < 0) { - return boost::optional > (); + return {}; } return r; @@ -114,6 +118,8 @@ public: } }; + } + #endif