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

Side by Side Diff: ui/gfx/rect_f.cc

Issue 10996037: Do not convert from RectF to Rect by flooring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing mac build. Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/rect_f.h ('k') | ui/gfx/rect_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/rect_f.h" 5 #include "ui/gfx/rect_f.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "ui/gfx/insets_f.h" 9 #include "ui/gfx/insets_f.h"
10 #include "ui/gfx/rect_base_impl.h" 10 #include "ui/gfx/rect_base_impl.h"
(...skipping 18 matching lines...) Expand all
29 RectF::RectF(const gfx::SizeF& size) 29 RectF::RectF(const gfx::SizeF& size)
30 : RectBaseT(size) { 30 : RectBaseT(size) {
31 } 31 }
32 32
33 RectF::RectF(const gfx::PointF& origin, const gfx::SizeF& size) 33 RectF::RectF(const gfx::PointF& origin, const gfx::SizeF& size)
34 : RectBaseT(origin, size) { 34 : RectBaseT(origin, size) {
35 } 35 }
36 36
37 RectF::~RectF() {} 37 RectF::~RectF() {}
38 38
39 Rect RectF::ToRect() const {
40 return Rect(origin().ToPoint(), size().ToSize());
41 }
42
43 std::string RectF::ToString() const { 39 std::string RectF::ToString() const {
44 return base::StringPrintf("%s %s", 40 return base::StringPrintf("%s %s",
45 origin().ToString().c_str(), 41 origin().ToString().c_str(),
46 size().ToString().c_str()); 42 size().ToString().c_str());
47 } 43 }
48 44
49 } // namespace gfx 45 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/rect_f.h ('k') | ui/gfx/rect_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698