| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 3 * Copyright (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 library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 { | 201 { |
| 202 m_hasToPointAtEndOfDuration = false; | 202 m_hasToPointAtEndOfDuration = false; |
| 203 parsePoint(fromString, m_fromPoint); | 203 parsePoint(fromString, m_fromPoint); |
| 204 parsePoint(toString, m_toPoint); | 204 parsePoint(toString, m_toPoint); |
| 205 return true; | 205 return true; |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool SVGAnimateMotionElement::calculateFromAndByValues(const String& fromString,
const String& byString) | 208 bool SVGAnimateMotionElement::calculateFromAndByValues(const String& fromString,
const String& byString) |
| 209 { | 209 { |
| 210 m_hasToPointAtEndOfDuration = false; | 210 m_hasToPointAtEndOfDuration = false; |
| 211 if (animationMode() == ByAnimation && !isAdditive()) | 211 if (getAnimationMode() == ByAnimation && !isAdditive()) |
| 212 return false; | 212 return false; |
| 213 parsePoint(fromString, m_fromPoint); | 213 parsePoint(fromString, m_fromPoint); |
| 214 FloatPoint byPoint; | 214 FloatPoint byPoint; |
| 215 parsePoint(byString, byPoint); | 215 parsePoint(byString, byPoint); |
| 216 m_toPoint = FloatPoint(m_fromPoint.x() + byPoint.x(), m_fromPoint.y() + byPo
int.y()); | 216 m_toPoint = FloatPoint(m_fromPoint.x() + byPoint.x(), m_fromPoint.y() + byPo
int.y()); |
| 217 return true; | 217 return true; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned
repeatCount, SVGSMILElement*) | 220 void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned
repeatCount, SVGSMILElement*) |
| 221 { | 221 { |
| 222 SVGElement* targetElement = this->targetElement(); | 222 SVGElement* targetElement = this->targetElement(); |
| 223 if (!targetElement) | 223 if (!targetElement) |
| 224 return; | 224 return; |
| 225 AffineTransform* transform = targetElement->animateMotionTransform(); | 225 AffineTransform* transform = targetElement->animateMotionTransform(); |
| 226 if (!transform) | 226 if (!transform) |
| 227 return; | 227 return; |
| 228 | 228 |
| 229 if (LayoutObject* targetLayoutObject = targetElement->layoutObject()) | 229 if (LayoutObject* targetLayoutObject = targetElement->layoutObject()) |
| 230 targetLayoutObject->setNeedsTransformUpdate(); | 230 targetLayoutObject->setNeedsTransformUpdate(); |
| 231 | 231 |
| 232 if (!isAdditive()) | 232 if (!isAdditive()) |
| 233 transform->makeIdentity(); | 233 transform->makeIdentity(); |
| 234 | 234 |
| 235 if (animationMode() != PathAnimation) { | 235 if (getAnimationMode() != PathAnimation) { |
| 236 FloatPoint toPointAtEndOfDuration = m_toPoint; | 236 FloatPoint toPointAtEndOfDuration = m_toPoint; |
| 237 if (isAccumulated() && repeatCount && m_hasToPointAtEndOfDuration) | 237 if (isAccumulated() && repeatCount && m_hasToPointAtEndOfDuration) |
| 238 toPointAtEndOfDuration = m_toPointAtEndOfDuration; | 238 toPointAtEndOfDuration = m_toPointAtEndOfDuration; |
| 239 | 239 |
| 240 float animatedX = 0; | 240 float animatedX = 0; |
| 241 animateAdditiveNumber(percentage, repeatCount, m_fromPoint.x(), m_toPoin
t.x(), toPointAtEndOfDuration.x(), animatedX); | 241 animateAdditiveNumber(percentage, repeatCount, m_fromPoint.x(), m_toPoin
t.x(), toPointAtEndOfDuration.x(), animatedX); |
| 242 | 242 |
| 243 float animatedY = 0; | 243 float animatedY = 0; |
| 244 animateAdditiveNumber(percentage, repeatCount, m_fromPoint.y(), m_toPoin
t.y(), toPointAtEndOfDuration.y(), animatedY); | 244 animateAdditiveNumber(percentage, repeatCount, m_fromPoint.y(), m_toPoin
t.y(), toPointAtEndOfDuration.y(), animatedY); |
| 245 | 245 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 312 |
| 313 void SVGAnimateMotionElement::updateAnimationMode() | 313 void SVGAnimateMotionElement::updateAnimationMode() |
| 314 { | 314 { |
| 315 if (!m_animationPath.isEmpty()) | 315 if (!m_animationPath.isEmpty()) |
| 316 setAnimationMode(PathAnimation); | 316 setAnimationMode(PathAnimation); |
| 317 else | 317 else |
| 318 SVGAnimationElement::updateAnimationMode(); | 318 SVGAnimationElement::updateAnimationMode(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 } // namespace blink | 321 } // namespace blink |
| OLD | NEW |