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

Side by Side Diff: Source/core/animation/NumberSVGInterpolation.cpp

Issue 1068973004: Web Animations: Support animation of SVG number attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 8 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/animation/NumberSVGInterpolation.h"
7
8 namespace blink {
9
10 PassRefPtrWillBeRawPtr<NumberSVGInterpolation> NumberSVGInterpolation::create(SV GPropertyBase* start, SVGPropertyBase* end, PassRefPtrWillBeRawPtr<SVGAnimatedPr opertyBase> attribute)
11 {
12 SVGNumberNegativeValuesMode negativeValuesMode = &attribute->attributeName() == &SVGNames::pathLengthAttr ? ForbidNegativeNumbers : AllowNegativeNumbers;
alancutter (OOO until 2018) 2015/04/20 07:39:40 It would be more consistent to have this property
Eric Willigers 2015/04/21 00:51:16 Done. Also done for IntegerOptionalInteger.
13 return adoptRefWillBeNoop(new NumberSVGInterpolation(toInterpolableValue(sta rt), toInterpolableValue(end), attribute, negativeValuesMode));
14 }
15
16 PassRefPtrWillBeRawPtr<SVGNumber> NumberSVGInterpolation::fromInterpolableValue( const InterpolableValue& value, SVGNumberNegativeValuesMode negativeValuesMode)
17 {
18 double doubleValue = toInterpolableNumber(value).value();
19 if (negativeValuesMode == ForbidNegativeNumbers && doubleValue < 0)
20 doubleValue = 0;
21 return SVGNumber::create(doubleValue);
22 }
23
24 }
OLDNEW
« no previous file with comments | « Source/core/animation/NumberSVGInterpolation.h ('k') | Source/core/animation/StringKeyframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698