OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 PassRefPtr<AnimatableValue> AnimatableLengthBox::interpolateTo(const AnimatableV
alue* value, double fraction) const | 35 PassRefPtr<AnimatableValue> AnimatableLengthBox::interpolateTo(const AnimatableV
alue* value, double fraction) const |
36 { | 36 { |
37 const AnimatableLengthBox* lengthBox = toAnimatableLengthBox(value); | 37 const AnimatableLengthBox* lengthBox = toAnimatableLengthBox(value); |
38 return AnimatableLengthBox::create( | 38 return AnimatableLengthBox::create( |
39 AnimatableValue::interpolate(this->left(), lengthBox->left(), fraction), | 39 AnimatableValue::interpolate(this->left(), lengthBox->left(), fraction), |
40 AnimatableValue::interpolate(this->right(), lengthBox->right(), fraction
), | 40 AnimatableValue::interpolate(this->right(), lengthBox->right(), fraction
), |
41 AnimatableValue::interpolate(this->top(), lengthBox->top(), fraction), | 41 AnimatableValue::interpolate(this->top(), lengthBox->top(), fraction), |
42 AnimatableValue::interpolate(this->bottom(), lengthBox->bottom(), fracti
on)); | 42 AnimatableValue::interpolate(this->bottom(), lengthBox->bottom(), fracti
on)); |
43 } | 43 } |
44 | 44 |
| 45 bool AnimatableLengthBox::usesDefaultInterpolationWith(const AnimatableValue* ot
her) const |
| 46 { |
| 47 const AnimatableLengthBox& otherBox = toAnimatableLengthBox(*other); |
| 48 return usesDefaultInterpolation(left(), otherBox.left()) |
| 49 || usesDefaultInterpolation(right(), otherBox.right()) |
| 50 || usesDefaultInterpolation(top(), otherBox.top()) |
| 51 || usesDefaultInterpolation(bottom(), otherBox.bottom()); |
| 52 } |
| 53 |
45 bool AnimatableLengthBox::equalTo(const AnimatableValue* value) const | 54 bool AnimatableLengthBox::equalTo(const AnimatableValue* value) const |
46 { | 55 { |
47 const AnimatableLengthBox* lengthBox = toAnimatableLengthBox(value); | 56 const AnimatableLengthBox* lengthBox = toAnimatableLengthBox(value); |
48 return left()->equals(lengthBox->left()) | 57 return left()->equals(lengthBox->left()) |
49 && right()->equals(lengthBox->right()) | 58 && right()->equals(lengthBox->right()) |
50 && top()->equals(lengthBox->top()) | 59 && top()->equals(lengthBox->top()) |
51 && bottom()->equals(lengthBox->bottom()); | 60 && bottom()->equals(lengthBox->bottom()); |
52 } | 61 } |
53 | 62 |
54 } // namespace blink | 63 } // namespace blink |
OLD | NEW |