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

Side by Side Diff: Source/core/layout/svg/LayoutSVGRect.cpp

Issue 896773002: [svg2] Make 'x' and 'y' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 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 | « Source/core/layout/style/SVGLayoutStyleDefs.cpp ('k') | Source/core/layout/svg/SVGPathData.cpp » ('j') | 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) 2011 University of Szeged 2 * Copyright (C) 2011 University of Szeged
3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
4 * All rights reserved. 4 * All rights reserved.
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (rect->rx()->currentValue()->value(lengthContext) > 0 67 if (rect->rx()->currentValue()->value(lengthContext) > 0
68 || rect->ry()->currentValue()->value(lengthContext) > 0 68 || rect->ry()->currentValue()->value(lengthContext) > 0
69 || hasNonScalingStroke() 69 || hasNonScalingStroke()
70 || !definitelyHasSimpleStroke()) { 70 || !definitelyHasSimpleStroke()) {
71 LayoutSVGShape::updateShapeFromElement(); 71 LayoutSVGShape::updateShapeFromElement();
72 m_usePathFallback = true; 72 m_usePathFallback = true;
73 return; 73 return;
74 } 74 }
75 } 75 }
76 76
77 m_fillBoundingBox = FloatRect(FloatPoint(rect->x()->currentValue()->value(le ngthContext), rect->y()->currentValue()->value(lengthContext)), boundingBoxSize) ; 77 m_fillBoundingBox = FloatRect(
78 FloatPoint(
79 lengthContext.valueForLength(style()->svgStyle().x(), LengthModeWidt h),
80 lengthContext.valueForLength(style()->svgStyle().y(), LengthModeHeig ht)),
81 boundingBoxSize);
78 82
79 // To decide if the stroke contains a point we create two rects which repres ent the inner and 83 // To decide if the stroke contains a point we create two rects which repres ent the inner and
80 // the outer stroke borders. A stroke contains the point, if the point is be tween them. 84 // the outer stroke borders. A stroke contains the point, if the point is be tween them.
81 m_innerStrokeRect = m_fillBoundingBox; 85 m_innerStrokeRect = m_fillBoundingBox;
82 m_outerStrokeRect = m_fillBoundingBox; 86 m_outerStrokeRect = m_fillBoundingBox;
83 87
84 if (style()->svgStyle().hasStroke()) { 88 if (style()->svgStyle().hasStroke()) {
85 float strokeWidth = this->strokeWidth(); 89 float strokeWidth = this->strokeWidth();
86 m_innerStrokeRect.inflate(-strokeWidth / 2); 90 m_innerStrokeRect.inflate(-strokeWidth / 2);
87 m_outerStrokeRect.inflate(strokeWidth / 2); 91 m_outerStrokeRect.inflate(strokeWidth / 2);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // An approximation of sqrt(2) is used here because at certain precise 134 // An approximation of sqrt(2) is used here because at certain precise
131 // miterlimits, the join style used might not be correct (e.g. a miterlimit 135 // miterlimits, the join style used might not be correct (e.g. a miterlimit
132 // of 1.4142135 should result in bevel joins, but may be drawn using miter 136 // of 1.4142135 should result in bevel joins, but may be drawn using miter
133 // joins). 137 // joins).
134 return svgStyle.strokeDashArray()->isEmpty() 138 return svgStyle.strokeDashArray()->isEmpty()
135 && svgStyle.joinStyle() == MiterJoin 139 && svgStyle.joinStyle() == MiterJoin
136 && svgStyle.strokeMiterLimit() >= 1.5; 140 && svgStyle.strokeMiterLimit() >= 1.5;
137 } 141 }
138 142
139 } 143 }
OLDNEW
« no previous file with comments | « Source/core/layout/style/SVGLayoutStyleDefs.cpp ('k') | Source/core/layout/svg/SVGPathData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698