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

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

Issue 947983002: Move zoom handling for x and y properties to svg (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move function 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
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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( 77 m_fillBoundingBox = FloatRect(
78 FloatPoint( 78 FloatPoint(
79 lengthContext.valueForLength(style()->svgStyle().x(), LengthModeWidt h), 79 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), LengthModeWidth),
80 lengthContext.valueForLength(style()->svgStyle().y(), LengthModeHeig ht)), 80 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), LengthModeHeight)),
81 boundingBoxSize); 81 boundingBoxSize);
82 82
83 // 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
84 // 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.
85 m_innerStrokeRect = m_fillBoundingBox; 85 m_innerStrokeRect = m_fillBoundingBox;
86 m_outerStrokeRect = m_fillBoundingBox; 86 m_outerStrokeRect = m_fillBoundingBox;
87 87
88 if (style()->svgStyle().hasStroke()) { 88 if (style()->svgStyle().hasStroke()) {
89 float strokeWidth = this->strokeWidth(); 89 float strokeWidth = this->strokeWidth();
90 m_innerStrokeRect.inflate(-strokeWidth / 2); 90 m_innerStrokeRect.inflate(-strokeWidth / 2);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // 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
135 // 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
136 // 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
137 // joins). 137 // joins).
138 return svgStyle.strokeDashArray()->isEmpty() 138 return svgStyle.strokeDashArray()->isEmpty()
139 && svgStyle.joinStyle() == MiterJoin 139 && svgStyle.joinStyle() == MiterJoin
140 && svgStyle.strokeMiterLimit() >= 1.5; 140 && svgStyle.strokeMiterLimit() >= 1.5;
141 } 141 }
142 142
143 } 143 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.cpp ('k') | Source/core/layout/svg/SVGPathData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698