OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. All rights reserved. |
4 * 2008 Eric Seidel <eric@webkit.org> | 4 * 2008 Eric Seidel <eric@webkit.org> |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 float diagonalLengthSquared() const | 95 float diagonalLengthSquared() const |
96 { | 96 { |
97 return m_width * m_width + m_height * m_height; | 97 return m_width * m_width + m_height * m_height; |
98 } | 98 } |
99 | 99 |
100 FloatSize transposedSize() const | 100 FloatSize transposedSize() const |
101 { | 101 { |
102 return FloatSize(m_height, m_width); | 102 return FloatSize(m_height, m_width); |
103 } | 103 } |
104 | 104 |
| 105 FloatSize scaledBy(float scale) const |
| 106 { |
| 107 return scaledBy(scale, scale); |
| 108 } |
| 109 |
| 110 FloatSize scaledBy(float scaleX, float scaleY) const |
| 111 { |
| 112 return FloatSize(m_width * scaleX, m_height * scaleY); |
| 113 } |
| 114 |
105 #if OS(MACOSX) | 115 #if OS(MACOSX) |
106 explicit FloatSize(const CGSize&); // don't do this implicitly since it's lo
ssy | 116 explicit FloatSize(const CGSize&); // don't do this implicitly since it's lo
ssy |
107 operator CGSize() const; | 117 operator CGSize() const; |
108 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) | 118 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) |
109 explicit FloatSize(const NSSize &); // don't do this implicitly since it's l
ossy | 119 explicit FloatSize(const NSSize &); // don't do this implicitly since it's l
ossy |
110 operator NSSize() const; | 120 operator NSSize() const; |
111 #endif | 121 #endif |
112 #endif | 122 #endif |
113 | 123 |
114 private: | 124 private: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 190 } |
181 | 191 |
182 inline IntPoint flooredIntPoint(const FloatSize& p) | 192 inline IntPoint flooredIntPoint(const FloatSize& p) |
183 { | 193 { |
184 return IntPoint(clampToInteger(floorf(p.width())), clampToInteger(floorf(p.h
eight()))); | 194 return IntPoint(clampToInteger(floorf(p.width())), clampToInteger(floorf(p.h
eight()))); |
185 } | 195 } |
186 | 196 |
187 } // namespace WebCore | 197 } // namespace WebCore |
188 | 198 |
189 #endif // FloatSize_h | 199 #endif // FloatSize_h |
OLD | NEW |