Changeset 166746 in webkit
- Timestamp:
- Apr 3, 2014 2:44:54 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r166736 r166746 1 2014-04-03 Dirk Schulze <krit@webkit.org> 2 3 [CG] Canvas lineDashOffset does not handle negative numbers correctly 4 https://bugs.webkit.org/show_bug.cgi?id=80560 5 6 Reviewed by Dean Jackson. 7 8 Test correct rendering of negative offset for Canvas dash arrays. 9 10 * fast/canvas/canvas-negative-lineDashOffset-expected.txt: Added. 11 * fast/canvas/canvas-negative-lineDashOffset.html: Added. 12 * fast/canvas/script-tests/canvas-negative-lineDashOffset.js: Added. 13 (dataToArray): 14 (getPixel): 15 (pixelShouldBe): 16 1 17 2014-04-03 David Hyatt <hyatt@apple.com> 2 18 -
trunk/Source/WebCore/ChangeLog
r166745 r166746 1 2014-04-03 Dirk Schulze <krit@webkit.org> 2 3 [CG] Canvas lineDashOffset does not handle negative numbers correctly 4 https://bugs.webkit.org/show_bug.cgi?id=80560 5 6 Reviewed by Dean Jackson. 7 8 CG ignores negative dash array offsets. Check if we have a negative offset, if yes 9 then calculate the length of the dash array and modulo the dash array offset with 10 the dash array length. 11 12 Test: fast/canvas/canvas-negative-lineDashOffset.html 13 14 * platform/graphics/cg/GraphicsContextCG.cpp: 15 (WebCore::GraphicsContext::setLineDash): 16 1 17 2014-04-03 David Hyatt <hyatt@apple.com> 2 18 -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r166100 r166746 1184 1184 void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset) 1185 1185 { 1186 if (dashOffset < 0) { 1187 float length = 0; 1188 for (size_t i = 0; i < dashes.size(); ++i) 1189 length += static_cast<float>(dashes[i]); 1190 if (length) 1191 dashOffset = fmod(dashOffset, length) + length; 1192 } 1186 1193 CGContextSetLineDash(platformContext(), dashOffset, dashes.data(), dashes.size()); 1187 1194 }
Note: See TracChangeset
for help on using the changeset viewer.