| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 appendArc(*marginVertices, thisEdge.vertex1(), margin, prevOffsetEdg
e.vertex2(), thisOffsetEdge.vertex1(), false); | 175 appendArc(*marginVertices, thisEdge.vertex1(), margin, prevOffsetEdg
e.vertex2(), thisOffsetEdge.vertex1(), false); |
| 176 } | 176 } |
| 177 | 177 |
| 178 snapVerticesToLayoutUnitGrid(*marginVertices); | 178 snapVerticesToLayoutUnitGrid(*marginVertices); |
| 179 return adoptPtr(new FloatPolygon(marginVertices.release(), fillRule)); | 179 return adoptPtr(new FloatPolygon(marginVertices.release(), fillRule)); |
| 180 } | 180 } |
| 181 | 181 |
| 182 const FloatPolygon& PolygonShape::shapePaddingBounds() const | 182 const FloatPolygon& PolygonShape::shapePaddingBounds() const |
| 183 { | 183 { |
| 184 ASSERT(shapePadding() >= 0); | 184 ASSERT(shapePadding() >= 0); |
| 185 if (!shapePadding()) | 185 if (!shapePadding() || m_polygon.isEmpty()) |
| 186 return m_polygon; | 186 return m_polygon; |
| 187 | 187 |
| 188 if (!m_paddingBounds) | 188 if (!m_paddingBounds) |
| 189 m_paddingBounds = computeShapePaddingBounds(m_polygon, shapePadding(), m
_polygon.fillRule()); | 189 m_paddingBounds = computeShapePaddingBounds(m_polygon, shapePadding(), m
_polygon.fillRule()); |
| 190 | 190 |
| 191 return *m_paddingBounds; | 191 return *m_paddingBounds; |
| 192 } | 192 } |
| 193 | 193 |
| 194 const FloatPolygon& PolygonShape::shapeMarginBounds() const | 194 const FloatPolygon& PolygonShape::shapeMarginBounds() const |
| 195 { | 195 { |
| 196 ASSERT(shapeMargin() >= 0); | 196 ASSERT(shapeMargin() >= 0); |
| 197 if (!shapeMargin()) | 197 if (!shapeMargin() || m_polygon.isEmpty()) |
| 198 return m_polygon; | 198 return m_polygon; |
| 199 | 199 |
| 200 if (!m_marginBounds) | 200 if (!m_marginBounds) |
| 201 m_marginBounds = computeShapeMarginBounds(m_polygon, shapeMargin(), m_po
lygon.fillRule()); | 201 m_marginBounds = computeShapeMarginBounds(m_polygon, shapeMargin(), m_po
lygon.fillRule()); |
| 202 | 202 |
| 203 return *m_marginBounds; | 203 return *m_marginBounds; |
| 204 } | 204 } |
| 205 | 205 |
| 206 static inline bool getVertexIntersectionVertices(const EdgeIntersection& interse
ction, FloatPoint& prevVertex, FloatPoint& thisVertex, FloatPoint& nextVertex) | 206 static inline bool getVertexIntersectionVertices(const EdgeIntersection& interse
ction, FloatPoint& prevVertex, FloatPoint& thisVertex, FloatPoint& nextVertex) |
| 207 { | 207 { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 } | 524 } |
| 525 | 525 |
| 526 if (firstFitFound) | 526 if (firstFitFound) |
| 527 result = LayoutUnit::fromFloatCeil(firstFitRect.y()); | 527 result = LayoutUnit::fromFloatCeil(firstFitRect.y()); |
| 528 return firstFitFound; | 528 return firstFitFound; |
| 529 } | 529 } |
| 530 | 530 |
| 531 } // namespace WebCore | 531 } // namespace WebCore |
| OLD | NEW |