Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(950)

Unified Diff: ui/gfx/box_f.h

Issue 25518002: Add BoxF::ExpandTo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/box_f.cc » ('j') | ui/gfx/box_f.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/box_f.h
diff --git a/ui/gfx/box_f.h b/ui/gfx/box_f.h
index fb2c1910a96ebe18375ab8eee821f136ea0b51a5..0dc7526078e798fdcb77cad4abefd474611647c5 100644
--- a/ui/gfx/box_f.h
+++ b/ui/gfx/box_f.h
@@ -94,7 +94,18 @@ class GFX_EXPORT BoxF {
const Point3F& origin() const { return origin_; }
void set_origin(const Point3F& origin) { origin_ = origin; }
+ // Expands the box to contain the given point, if necessary.
danakj 2013/10/01 15:09:15 Comment on what happens if |this| is empty? I see
+ void ExpandTo(const Point3F& point);
+
private:
+ // Expands the box to contain the two given points. It is required that each
+ // component of |min| is less than or equal to the corresponding component in
+ // |max|. Precisely, what this function does is ensure that after the function
+ // completes, |this| contains origin_, min, max, and origin_ + (width_,
+ // height_, depth_), even if the box is empty. Emptiness checks are handled in
+ // the public function Union.
+ void ExpandTo(const Point3F& min, const Point3F& max);
+
Point3F origin_;
float width_;
float height_;
« no previous file with comments | « no previous file | ui/gfx/box_f.cc » ('j') | ui/gfx/box_f.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698