Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1114)

Side by Side Diff: Source/core/rendering/shapes/PolygonShape.cpp

Issue 286813002: [CSS Shapes] line height grows around polygon and incorrectly causes text to wrap to next line (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix prefixes and whitespace Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-edge-case-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (y == minY()) 62 if (y == minY())
63 return vertex1().y() < vertex2().y() ? vertex1().x() : vertex2().x(); 63 return vertex1().y() < vertex2().y() ? vertex1().x() : vertex2().x();
64 if (y == maxY()) 64 if (y == maxY())
65 return vertex1().y() > vertex2().y() ? vertex1().x() : vertex2().x(); 65 return vertex1().y() > vertex2().y() ? vertex1().x() : vertex2().x();
66 66
67 return vertex1().x() + ((y - vertex1().y()) * (vertex2().x() - vertex1().x() ) / (vertex2().y() - vertex1().y())); 67 return vertex1().x() + ((y - vertex1().y()) * (vertex2().x() - vertex1().x() ) / (vertex2().y() - vertex1().y()));
68 } 68 }
69 69
70 FloatShapeInterval OffsetPolygonEdge::clippedEdgeXRange(float y1, float y2) cons t 70 FloatShapeInterval OffsetPolygonEdge::clippedEdgeXRange(float y1, float y2) cons t
71 { 71 {
72 if (!overlapsYRange(y1, y2) || (y1 == maxY() && vertex2().y() < vertex1().y( ))) 72 if (!overlapsYRange(y1, y2) || (y1 == maxY() && minY() <= y1) || (y2 == minY () && maxY() >= y2))
73 return FloatShapeInterval(); 73 return FloatShapeInterval();
74 74
75 if (isWithinYRange(y1, y2)) 75 if (isWithinYRange(y1, y2))
76 return FloatShapeInterval(minX(), maxX()); 76 return FloatShapeInterval(minX(), maxX());
77 77
78 // Clip the edge line segment to the vertical range y1,y2 and then return 78 // Clip the edge line segment to the vertical range y1,y2 and then return
79 // the clipped line segment's horizontal range. 79 // the clipped line segment's horizontal range.
80 80
81 FloatPoint minYVertex; 81 FloatPoint minYVertex;
82 FloatPoint maxYVertex; 82 FloatPoint maxYVertex;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 { 154 {
155 if (!m_polygon.numberOfVertices()) 155 if (!m_polygon.numberOfVertices())
156 return; 156 return;
157 paths.shape.moveTo(m_polygon.vertexAt(0)); 157 paths.shape.moveTo(m_polygon.vertexAt(0));
158 for (size_t i = 1; i < m_polygon.numberOfVertices(); ++i) 158 for (size_t i = 1; i < m_polygon.numberOfVertices(); ++i)
159 paths.shape.addLineTo(m_polygon.vertexAt(i)); 159 paths.shape.addLineTo(m_polygon.vertexAt(i));
160 paths.shape.closeSubpath(); 160 paths.shape.closeSubpath();
161 } 161 }
162 162
163 } // namespace WebCore 163 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-edge-case-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698