Index: webrtc/modules/desktop_capture/desktop_geometry.cc |
diff --git a/webrtc/modules/desktop_capture/desktop_geometry.cc b/webrtc/modules/desktop_capture/desktop_geometry.cc |
index 2af8cf826e4dc70193e58569b0e6824eddc140de..37b31998272afdb01f66402b8a6dca3e74bd8544 100644 |
--- a/webrtc/modules/desktop_capture/desktop_geometry.cc |
+++ b/webrtc/modules/desktop_capture/desktop_geometry.cc |
@@ -37,6 +37,20 @@ void DesktopRect::IntersectWith(const DesktopRect& rect) { |
} |
} |
+void DesktopRect::UnionWith(const DesktopRect& rect) { |
+ if (is_empty()) { |
+ left_ = rect.left(); |
Sergey Ulanov
2017/05/16 19:53:00
*this = rect;
Hzj_jie
2017/05/16 23:04:18
Done.
|
+ top_ = rect.top(); |
+ right_ = rect.right(); |
+ bottom_ = rect.bottom(); |
+ } else if (!rect.is_empty()) { |
Sergey Ulanov
2017/05/16 19:53:00
I'd prefer to format this function as follows:
Hzj_jie
2017/05/16 23:04:18
Done.
|
+ left_ = std::min(left(), rect.left()); |
+ top_ = std::min(top(), rect.top()); |
+ right_ = std::max(right(), rect.right()); |
+ bottom_ = std::max(bottom(), rect.bottom()); |
+ } |
+} |
+ |
void DesktopRect::Translate(int32_t dx, int32_t dy) { |
left_ += dx; |
top_ += dy; |