OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
3 (C) 2007 Rob Buis <buis@kde.org> | 3 (C) 2007 Rob Buis <buis@kde.org> |
4 Copyright (C) 2008 Apple Inc. All Rights Reserved. | 4 Copyright (C) 2008 Apple Inc. All Rights Reserved. |
5 | 5 |
6 This file is part of the WebKit project | 6 This file is part of the WebKit project |
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 | 144 |
145 void SVGAnimateMotionElement::resetToBaseValue(const String&) | 145 void SVGAnimateMotionElement::resetToBaseValue(const String&) |
146 { | 146 { |
147 if (!hasValidTarget()) | 147 if (!hasValidTarget()) |
148 return; | 148 return; |
149 SVGElement* target = targetElement(); | 149 SVGElement* target = targetElement(); |
150 TransformationMatrix* transform = target->supplementalTransform(); | 150 TransformationMatrix* transform = target->supplementalTransform(); |
151 if (!transform) | 151 if (!transform) |
152 return; | 152 return; |
153 transform->reset(); | 153 transform->makeIdentity(); |
154 } | 154 } |
155 | 155 |
156 bool SVGAnimateMotionElement::calculateFromAndToValues(const String& fromString,
const String& toString) | 156 bool SVGAnimateMotionElement::calculateFromAndToValues(const String& fromString,
const String& toString) |
157 { | 157 { |
158 parsePoint(fromString, m_fromPoint); | 158 parsePoint(fromString, m_fromPoint); |
159 parsePoint(toString, m_toPoint); | 159 parsePoint(toString, m_toPoint); |
160 return true; | 160 return true; |
161 } | 161 } |
162 | 162 |
163 bool SVGAnimateMotionElement::calculateFromAndByValues(const String& fromString,
const String& byString) | 163 bool SVGAnimateMotionElement::calculateFromAndByValues(const String& fromString,
const String& byString) |
164 { | 164 { |
165 parsePoint(fromString, m_fromPoint); | 165 parsePoint(fromString, m_fromPoint); |
166 FloatPoint byPoint; | 166 FloatPoint byPoint; |
167 parsePoint(byString, byPoint); | 167 parsePoint(byString, byPoint); |
168 m_toPoint = FloatPoint(m_fromPoint.x() + byPoint.x(), m_fromPoint.y() + byPo
int.y()); | 168 m_toPoint = FloatPoint(m_fromPoint.x() + byPoint.x(), m_fromPoint.y() + byPo
int.y()); |
169 return true; | 169 return true; |
170 } | 170 } |
171 | 171 |
172 void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned,
SVGSMILElement*) | 172 void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned,
SVGSMILElement*) |
173 { | 173 { |
174 SVGElement* target = targetElement(); | 174 SVGElement* target = targetElement(); |
175 if (!target) | 175 if (!target) |
176 return; | 176 return; |
177 TransformationMatrix* transform = target->supplementalTransform(); | 177 TransformationMatrix* transform = target->supplementalTransform(); |
178 if (!transform) | 178 if (!transform) |
179 return; | 179 return; |
180 | 180 |
181 if (!isAdditive()) | 181 if (!isAdditive()) |
182 transform->reset(); | 182 transform->makeIdentity(); |
183 | 183 |
184 // FIXME: Implement accumulate. | 184 // FIXME: Implement accumulate. |
185 | 185 |
186 if (animationMode() == PathAnimation) { | 186 if (animationMode() == PathAnimation) { |
187 ASSERT(!animationPath().isEmpty()); | 187 ASSERT(!animationPath().isEmpty()); |
188 Path path = animationPath(); | 188 Path path = animationPath(); |
189 float positionOnPath = path.length() * percentage; | 189 float positionOnPath = path.length() * percentage; |
190 bool ok; | 190 bool ok; |
191 FloatPoint position = path.pointAtLength(positionOnPath, ok); | 191 FloatPoint position = path.pointAtLength(positionOnPath, ok); |
192 if (ok) { | 192 if (ok) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 FloatSize diff = to - from; | 237 FloatSize diff = to - from; |
238 return sqrtf(diff.width() * diff.width() + diff.height() * diff.height()); | 238 return sqrtf(diff.width() * diff.width() + diff.height() * diff.height()); |
239 } | 239 } |
240 | 240 |
241 } | 241 } |
242 | 242 |
243 #endif // ENABLE(SVG) | 243 #endif // ENABLE(SVG) |
244 | 244 |
245 // vim:ts=4:noet | 245 // vim:ts=4:noet |
246 | 246 |
OLD | NEW |