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

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

Issue 1186133003: gfx: Fix ToEnclosing/ToEnclosed math to deal with big numbers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move function Created 5 years, 6 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
Index: ui/gfx/geometry/rect.cc
diff --git a/ui/gfx/geometry/rect.cc b/ui/gfx/geometry/rect.cc
index 25bc9f55a9c0c8eb11baf585423368548baa2b23..5c429232cab4cf9301ac366f7325f5a386e1c531 100644
--- a/ui/gfx/geometry/rect.cc
+++ b/ui/gfx/geometry/rect.cc
@@ -17,6 +17,7 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "ui/gfx/geometry/insets.h"
+#include "ui/gfx/geometry/rect_conversions.h"
namespace gfx {
@@ -282,4 +283,8 @@ Rect BoundingRect(const Point& p1, const Point& p2) {
return Rect(rx, ry, rr - rx, rb - ry);
}
+Rect SafelyScaleToEnclosingRect(const Rect& rect, float scale) {
+ return ToEnclosingRect(ScaleRect(rect, scale));
+}
+
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698