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

Side by Side Diff: ui/gfx/size_base_impl.h

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/size_base.h ('k') | ui/gfx/size_f.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/gfx/size_base.h"
6
7 #include "base/logging.h"
8 #include "base/stringprintf.h"
9
10 // This file provides the implementation for SizeBaese template and
11 // used to instantiate the base class for Size and SizeF classes.
12 #if !defined(UI_IMPLEMENTATION)
13 #error "This file is intended for UI implementation only"
14 #endif
15
16 namespace gfx {
17
18 template<typename Class, typename Type>
19 SizeBase<Class, Type>::SizeBase(Type width, Type height) {
20 set_width(width);
21 set_height(height);
22 }
23
24 template<typename Class, typename Type>
25 SizeBase<Class, Type>::~SizeBase() {}
26
27 template<typename Class, typename Type>
28 void SizeBase<Class, Type>::set_width(Type width) {
29 if (width < 0) {
30 NOTREACHED() << "negative width:" << width;
31 width = 0;
32 }
33 width_ = width;
34 }
35
36 template<typename Class, typename Type>
37 void SizeBase<Class, Type>::set_height(Type height) {
38 if (height < 0) {
39 NOTREACHED() << "negative height:" << height;
40 height = 0;
41 }
42 height_ = height;
43 }
44
45 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/size_base.h ('k') | ui/gfx/size_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698