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

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

Issue 2327903002: gfx: Do the ToEnclosingRect in double precision. (Closed)
Patch Set: update Created 4 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 | « cc/playback/discardable_image_map_unittest.cc ('k') | ui/gfx/geometry/rect_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/rect_conversions.cc
diff --git a/ui/gfx/geometry/rect_conversions.cc b/ui/gfx/geometry/rect_conversions.cc
index 412041a4163952c0e9cb60f7839a08c5b19120f9..b4ef3d44ec9c4e434b93ae64531cde2f6197014e 100644
--- a/ui/gfx/geometry/rect_conversions.cc
+++ b/ui/gfx/geometry/rect_conversions.cc
@@ -21,12 +21,14 @@ Rect ToEnclosingRect(const RectF& rect) {
rect.width() == 0
? 0
: std::max(
- ToCeiledInt(static_cast<float>(ToCeiledInt(max_x)) - min_x), 0);
+ ToCeiledInt(static_cast<double>(ToCeiledInt(max_x)) - min_x),
+ 0);
int height =
rect.height() == 0
? 0
: std::max(
- ToCeiledInt(static_cast<float>(ToCeiledInt(max_y)) - min_y), 0);
+ ToCeiledInt(static_cast<double>(ToCeiledInt(max_y)) - min_y),
+ 0);
return Rect(min_x, min_y, width, height);
}
« no previous file with comments | « cc/playback/discardable_image_map_unittest.cc ('k') | ui/gfx/geometry/rect_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698