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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/LayoutRectOutsets.h

Issue 1648573002: Transition to explicit constructors in LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar tweaks! Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, Google Inc. All rights reserved. 2 * Copyright (c) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 namespace blink { 42 namespace blink {
43 43
44 // Specifies LayoutUnit lengths to be used to expand a rectangle. 44 // Specifies LayoutUnit lengths to be used to expand a rectangle.
45 // For example, |top()| returns the distance the top edge should be moved 45 // For example, |top()| returns the distance the top edge should be moved
46 // upward. 46 // upward.
47 // 47 //
48 // Negative lengths can be used to express insets. 48 // Negative lengths can be used to express insets.
49 class PLATFORM_EXPORT LayoutRectOutsets { 49 class PLATFORM_EXPORT LayoutRectOutsets {
50 DISALLOW_NEW(); 50 DISALLOW_NEW();
51 public: 51 public:
52 LayoutRectOutsets() : m_top(0), m_right(0), m_bottom(0), m_left(0) { } 52 LayoutRectOutsets() { }
53 LayoutRectOutsets(LayoutUnit top, LayoutUnit right, LayoutUnit bottom, Layou tUnit left) 53 LayoutRectOutsets(LayoutUnit top, LayoutUnit right, LayoutUnit bottom, Layou tUnit left)
54 : m_top(top), m_right(right), m_bottom(bottom), m_left(left) { } 54 : m_top(top), m_right(right), m_bottom(bottom), m_left(left) { }
55 55
56 LayoutRectOutsets(const IntRectOutsets& outsets) 56 LayoutRectOutsets(const IntRectOutsets& outsets)
57 : m_top(outsets.top()) 57 : m_top(LayoutUnit(outsets.top()))
58 , m_right(outsets.right()) 58 , m_right(LayoutUnit(outsets.right()))
59 , m_bottom(outsets.bottom()) 59 , m_bottom(LayoutUnit(outsets.bottom()))
60 , m_left(outsets.left()) 60 , m_left(LayoutUnit(outsets.left()))
61 { 61 {
62 } 62 }
63 63
64 LayoutRectOutsets(const FloatRectOutsets& outsets) 64 LayoutRectOutsets(const FloatRectOutsets& outsets)
65 : m_top(outsets.top()) 65 : m_top(LayoutUnit(outsets.top()))
66 , m_right(outsets.right()) 66 , m_right(LayoutUnit(outsets.right()))
67 , m_bottom(outsets.bottom()) 67 , m_bottom(LayoutUnit(outsets.bottom()))
68 , m_left(outsets.left()) 68 , m_left(LayoutUnit(outsets.left()))
69 { 69 {
70 } 70 }
71 71
72 LayoutUnit top() const { return m_top; } 72 LayoutUnit top() const { return m_top; }
73 LayoutUnit right() const { return m_right; } 73 LayoutUnit right() const { return m_right; }
74 LayoutUnit bottom() const { return m_bottom; } 74 LayoutUnit bottom() const { return m_bottom; }
75 LayoutUnit left() const { return m_left; } 75 LayoutUnit left() const { return m_left; }
76 76
77 void setTop(LayoutUnit value) { m_top = value; } 77 void setTop(LayoutUnit value) { m_top = value; }
78 void setRight(LayoutUnit value) { m_right = value; } 78 void setRight(LayoutUnit value) { m_right = value; }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 private: 114 private:
115 LayoutUnit m_top; 115 LayoutUnit m_top;
116 LayoutUnit m_right; 116 LayoutUnit m_right;
117 LayoutUnit m_bottom; 117 LayoutUnit m_bottom;
118 LayoutUnit m_left; 118 LayoutUnit m_left;
119 }; 119 };
120 120
121 } // namespace blink 121 } // namespace blink
122 122
123 #endif // LayoutRectOutsets_h 123 #endif // LayoutRectOutsets_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698