OLD | NEW |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void clampNegativeToZero() | 75 void clampNegativeToZero() |
76 { | 76 { |
77 *this = expandedTo(zero()); | 77 *this = expandedTo(zero()); |
78 } | 78 } |
79 | 79 |
80 LayoutPoint transposedPoint() const | 80 LayoutPoint transposedPoint() const |
81 { | 81 { |
82 return LayoutPoint(m_y, m_x); | 82 return LayoutPoint(m_y, m_x); |
83 } | 83 } |
84 | 84 |
| 85 LayoutPoint fraction() const |
| 86 { |
| 87 return LayoutPoint(m_x.fraction(), m_y.fraction()); |
| 88 } |
| 89 |
85 private: | 90 private: |
86 LayoutUnit m_x, m_y; | 91 LayoutUnit m_x, m_y; |
87 }; | 92 }; |
88 | 93 |
89 inline LayoutPoint& operator+=(LayoutPoint& a, const LayoutSize& b) | 94 inline LayoutPoint& operator+=(LayoutPoint& a, const LayoutSize& b) |
90 { | 95 { |
91 a.move(b.width(), b.height()); | 96 a.move(b.width(), b.height()); |
92 return a; | 97 return a; |
93 } | 98 } |
94 | 99 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 200 |
196 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) | 201 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) |
197 { | 202 { |
198 return flooredLayoutPoint(FloatPoint(s)); | 203 return flooredLayoutPoint(FloatPoint(s)); |
199 } | 204 } |
200 | 205 |
201 | 206 |
202 } // namespace WebCore | 207 } // namespace WebCore |
203 | 208 |
204 #endif // LayoutPoint_h | 209 #endif // LayoutPoint_h |
OLD | NEW |