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

Unified Diff: ui/gfx/geometry/size_f.cc

Issue 2749513011: Stabilize empty rect handling in EnclosingRect. (Closed)
Patch Set: Use size in Enclosing computation Created 3 years, 9 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
« ui/gfx/geometry/rect_conversions.cc ('K') | « ui/gfx/geometry/size_f.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/size_f.cc
diff --git a/ui/gfx/geometry/size_f.cc b/ui/gfx/geometry/size_f.cc
index 6d08e18c62ea5b1ad33dee9cecf26e0ff347e47a..571803099164552de693a14afd1c33598a0e7015 100644
--- a/ui/gfx/geometry/size_f.cc
+++ b/ui/gfx/geometry/size_f.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <limits>
Peter Mayo 2017/03/20 18:53:50 remove
+
#include "ui/gfx/geometry/size_f.h"
#include "base/strings/stringprintf.h"
@@ -17,13 +19,13 @@ void SizeF::Enlarge(float grow_width, float grow_height) {
}
void SizeF::SetToMin(const SizeF& other) {
- width_ = width() <= other.width() ? width() : other.width();
- height_ = height() <= other.height() ? height() : other.height();
+ set_width(width() <= other.width() ? width() : other.width());
+ set_height(height() <= other.height() ? height() : other.height());
}
void SizeF::SetToMax(const SizeF& other) {
- width_ = width() >= other.width() ? width() : other.width();
- height_ = height() >= other.height() ? height() : other.height();
+ set_width(width() >= other.width() ? width() : other.width());
+ set_height(height() >= other.height() ? height() : other.height());
}
std::string SizeF::ToString() const {
« ui/gfx/geometry/rect_conversions.cc ('K') | « ui/gfx/geometry/size_f.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698