OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 if (!width && !height) | 74 if (!width && !height) |
75 return path; | 75 return path; |
76 | 76 |
77 float x = lengthContext.valueForLength(svgStyle.x(), style, SVGLengthMode::W
idth); | 77 float x = lengthContext.valueForLength(svgStyle.x(), style, SVGLengthMode::W
idth); |
78 float y = lengthContext.valueForLength(svgStyle.y(), style, SVGLengthMode::H
eight); | 78 float y = lengthContext.valueForLength(svgStyle.y(), style, SVGLengthMode::H
eight); |
79 float rx = lengthContext.valueForLength(svgStyle.rx(), style, SVGLengthMode:
:Width); | 79 float rx = lengthContext.valueForLength(svgStyle.rx(), style, SVGLengthMode:
:Width); |
80 float ry = lengthContext.valueForLength(svgStyle.ry(), style, SVGLengthMode:
:Height); | 80 float ry = lengthContext.valueForLength(svgStyle.ry(), style, SVGLengthMode:
:Height); |
81 bool hasRx = rx > 0; | 81 bool hasRx = rx > 0; |
82 bool hasRy = ry > 0; | 82 bool hasRy = ry > 0; |
83 if (hasRx || hasRy) { | 83 if (hasRx || hasRy) { |
84 if (!hasRx) | 84 if (svgStyle.rx().isAuto()) |
85 rx = ry; | 85 rx = ry; |
86 else if (!hasRy) | 86 else if (svgStyle.ry().isAuto()) |
87 ry = rx; | 87 ry = rx; |
88 | 88 |
89 path.addRoundedRect(FloatRect(x, y, width, height), FloatSize(rx, ry)); | 89 path.addRoundedRect(FloatRect(x, y, width, height), FloatSize(rx, ry)); |
90 return path; | 90 return path; |
91 } | 91 } |
92 | 92 |
93 path.addRect(FloatRect(x, y, width, height)); | 93 path.addRect(FloatRect(x, y, width, height)); |
94 return path; | 94 return path; |
95 } | 95 } |
96 | 96 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 || m_rx->currentValue()->isRelative() | 165 || m_rx->currentValue()->isRelative() |
166 || m_ry->currentValue()->isRelative(); | 166 || m_ry->currentValue()->isRelative(); |
167 } | 167 } |
168 | 168 |
169 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) | 169 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) |
170 { | 170 { |
171 return new LayoutSVGRect(this); | 171 return new LayoutSVGRect(this); |
172 } | 172 } |
173 | 173 |
174 } // namespace blink | 174 } // namespace blink |
OLD | NEW |