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 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 static void setGradientAttributes(SVGGradientElement* element, LinearGradientAtt
ributes& attributes, bool isLinear = true) | 108 static void setGradientAttributes(SVGGradientElement* element, LinearGradientAtt
ributes& attributes, bool isLinear = true) |
109 { | 109 { |
110 if (!attributes.hasSpreadMethod() && element->spreadMethod()->isSpecified()) | 110 if (!attributes.hasSpreadMethod() && element->spreadMethod()->isSpecified()) |
111 attributes.setSpreadMethod(element->spreadMethod()->currentValue()->enum
Value()); | 111 attributes.setSpreadMethod(element->spreadMethod()->currentValue()->enum
Value()); |
112 | 112 |
113 if (!attributes.hasGradientUnits() && element->gradientUnits()->isSpecified(
)) | 113 if (!attributes.hasGradientUnits() && element->gradientUnits()->isSpecified(
)) |
114 attributes.setGradientUnits(element->gradientUnits()->currentValue()->en
umValue()); | 114 attributes.setGradientUnits(element->gradientUnits()->currentValue()->en
umValue()); |
115 | 115 |
116 if (!attributes.hasGradientTransform()) { | 116 if (!attributes.hasGradientTransform() && element->gradientTransform()->isSp
ecified()) { |
117 attributes.setGradientTransformFromStyle(element); | 117 AffineTransform transform; |
| 118 element->gradientTransform()->currentValue()->concatenate(transform); |
| 119 attributes.setGradientTransform(transform); |
118 } | 120 } |
119 | 121 |
120 if (!attributes.hasStops()) { | 122 if (!attributes.hasStops()) { |
121 const Vector<Gradient::ColorStop>& stops(element->buildStops()); | 123 const Vector<Gradient::ColorStop>& stops(element->buildStops()); |
122 if (!stops.isEmpty()) | 124 if (!stops.isEmpty()) |
123 attributes.setStops(stops); | 125 attributes.setStops(stops); |
124 } | 126 } |
125 | 127 |
126 if (isLinear) { | 128 if (isLinear) { |
127 SVGLinearGradientElement* linear = toSVGLinearGradientElement(element); | 129 SVGLinearGradientElement* linear = toSVGLinearGradientElement(element); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 179 |
178 bool SVGLinearGradientElement::selfHasRelativeLengths() const | 180 bool SVGLinearGradientElement::selfHasRelativeLengths() const |
179 { | 181 { |
180 return m_x1->currentValue()->isRelative() | 182 return m_x1->currentValue()->isRelative() |
181 || m_y1->currentValue()->isRelative() | 183 || m_y1->currentValue()->isRelative() |
182 || m_x2->currentValue()->isRelative() | 184 || m_x2->currentValue()->isRelative() |
183 || m_y2->currentValue()->isRelative(); | 185 || m_y2->currentValue()->isRelative(); |
184 } | 186 } |
185 | 187 |
186 } | 188 } |
OLD | NEW |