| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 float lengthSquared() const | 116 float lengthSquared() const |
| 117 { | 117 { |
| 118 return m_x * m_x + m_y * m_y; | 118 return m_x * m_x + m_y * m_y; |
| 119 } | 119 } |
| 120 | 120 |
| 121 FloatPoint expandedTo(const FloatPoint& other) const | 121 FloatPoint expandedTo(const FloatPoint& other) const |
| 122 { | 122 { |
| 123 return FloatPoint(std::max(m_x, other.m_x), std::max(m_y, other.m_y)); | 123 return FloatPoint(std::max(m_x, other.m_x), std::max(m_y, other.m_y)); |
| 124 } | 124 } |
| 125 | 125 |
| 126 FloatPoint shrunkTo(const FloatPoint& other) const |
| 127 { |
| 128 return FloatPoint(std::min(m_x, other.m_x), std::min(m_y, other.m_y)); |
| 129 } |
| 130 |
| 126 FloatPoint transposedPoint() const | 131 FloatPoint transposedPoint() const |
| 127 { | 132 { |
| 128 return FloatPoint(m_y, m_x); | 133 return FloatPoint(m_y, m_x); |
| 129 } | 134 } |
| 130 | 135 |
| 131 #if OS(MACOSX) | 136 #if OS(MACOSX) |
| 132 FloatPoint(const CGPoint&); | 137 FloatPoint(const CGPoint&); |
| 133 operator CGPoint() const; | 138 operator CGPoint() const; |
| 134 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) | 139 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) |
| 135 FloatPoint(const NSPoint&); | 140 FloatPoint(const NSPoint&); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 234 } |
| 230 | 235 |
| 231 PLATFORM_EXPORT float findSlope(const FloatPoint& p1, const FloatPoint& p2, floa
t& c); | 236 PLATFORM_EXPORT float findSlope(const FloatPoint& p1, const FloatPoint& p2, floa
t& c); |
| 232 | 237 |
| 233 // Find point where lines through the two pairs of points intersect. Returns fal
se if the lines don't intersect. | 238 // Find point where lines through the two pairs of points intersect. Returns fal
se if the lines don't intersect. |
| 234 PLATFORM_EXPORT bool findIntersection(const FloatPoint& p1, const FloatPoint& p2
, const FloatPoint& d1, const FloatPoint& d2, FloatPoint& intersection); | 239 PLATFORM_EXPORT bool findIntersection(const FloatPoint& p1, const FloatPoint& p2
, const FloatPoint& d1, const FloatPoint& d2, FloatPoint& intersection); |
| 235 | 240 |
| 236 } | 241 } |
| 237 | 242 |
| 238 #endif | 243 #endif |
| OLD | NEW |