Commit 71ca9bc0 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add Rectangle print operator

parent 95c403cb
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#include <algorithm>
#include <iostream>
#include "layout.h"

namespace plotfx {
@@ -62,6 +63,18 @@ Rectangle layout_margin_box(
  return box;
}

std::ostream& operator <<(std::ostream& os, const Rectangle& r) {
  os << "Rectangle(";
  os << r.x;
  os << ", ";
  os << r.y;
  os << ", ";
  os << r.w;
  os << ", ";
  os << r.h;
  os << ")";
  return os;
}

} // namespace plotfx
+2 −0
Original line number Diff line number Diff line
@@ -50,5 +50,7 @@ Rectangle layout_margin_box(
    double margin_bottom,
    double margin_left);

std::ostream& operator <<(std::ostream& os, const Rectangle& c);

} // namespace plotfx