From df0fc30fdae6f42d29dc6b51f6bd9424cd90833b Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 7 Sep 2016 22:19:30 -0700 Subject: [PATCH] Rect: Comment about a bad API method. In retrospect, I don't like Rect + Rect = union -- it doesn't make as much sense and isn't as readable as Rect.union(Rect). --- firmware/common/ui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/common/ui.cpp b/firmware/common/ui.cpp index d6d881d63..5b0f55b2b 100644 --- a/firmware/common/ui.cpp +++ b/firmware/common/ui.cpp @@ -42,6 +42,8 @@ Rect Rect::intersect(const Rect& o) const { } } +// TODO: This violates the principle of least surprise! +// This does a union, but that might not be obvious from "+=" syntax. Rect& Rect::operator+=(const Rect& p) { if( is_empty() ) { *this = p;