| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 LayoutUnit width() const { return m_width; } | 55 LayoutUnit width() const { return m_width; } |
| 56 LayoutUnit height() const { return m_height; } | 56 LayoutUnit height() const { return m_height; } |
| 57 | 57 |
| 58 void setWidth(LayoutUnit width) { m_width = width; } | 58 void setWidth(LayoutUnit width) { m_width = width; } |
| 59 void setHeight(LayoutUnit height) { m_height = height; } | 59 void setHeight(LayoutUnit height) { m_height = height; } |
| 60 | 60 |
| 61 bool isEmpty() const { return m_width.rawValue() <= 0 || m_height.rawValue()
<= 0; } | 61 bool isEmpty() const { return m_width.rawValue() <= 0 || m_height.rawValue()
<= 0; } |
| 62 bool isZero() const { return !m_width && !m_height; } | 62 bool isZero() const { return !m_width && !m_height; } |
| 63 | 63 |
| 64 float aspectRatio() const { return static_cast<float>(m_width) / static_cast
<float>(m_height); } | 64 float aspectRatio() const { return m_width.toFloat() / m_height.toFloat(); } |
| 65 | 65 |
| 66 void expand(LayoutUnit width, LayoutUnit height) | 66 void expand(LayoutUnit width, LayoutUnit height) |
| 67 { | 67 { |
| 68 m_width += width; | 68 m_width += width; |
| 69 m_height += height; | 69 m_height += height; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void shrink(LayoutUnit width, LayoutUnit height) | 72 void shrink(LayoutUnit width, LayoutUnit height) |
| 73 { | 73 { |
| 74 m_width -= width; | 74 m_width -= width; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 inline LayoutSize roundedLayoutSize(const FloatSize& s) | 187 inline LayoutSize roundedLayoutSize(const FloatSize& s) |
| 188 { | 188 { |
| 189 return LayoutSize(s); | 189 return LayoutSize(s); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace WebCore | 192 } // namespace WebCore |
| 193 | 193 |
| 194 #endif // LayoutSize_h | 194 #endif // LayoutSize_h |
| OLD | NEW |