| 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 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 float value(const SVGLengthContext&) const; | 57 float value(const SVGLengthContext&) const; |
| 58 void setValue(float, const SVGLengthContext&); | 58 void setValue(float, const SVGLengthContext&); |
| 59 | 59 |
| 60 float valueInSpecifiedUnits() const { return m_value->getFloatValue(); } | 60 float valueInSpecifiedUnits() const { return m_value->getFloatValue(); } |
| 61 void setValueInSpecifiedUnits(float value) | 61 void setValueInSpecifiedUnits(float value) |
| 62 { | 62 { |
| 63 m_value = CSSPrimitiveValue::create(value, m_value->typeWithCalcResolved
()); | 63 m_value = CSSPrimitiveValue::create(value, m_value->typeWithCalcResolved
()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 CSSPrimitiveValue* asCSSPrimitiveValue() const { return m_value.get(); } | 66 const CSSPrimitiveValue* asCSSPrimitiveValue() const { return m_value.get();
} |
| 67 | 67 |
| 68 // Resolves LengthTypePercentage into a normalized floating point number (fu
ll value is 1.0). | 68 // Resolves LengthTypePercentage into a normalized floating point number (fu
ll value is 1.0). |
| 69 float valueAsPercentage() const; | 69 float valueAsPercentage() const; |
| 70 | 70 |
| 71 // Returns a number to be used as percentage (so full value is 100) | 71 // Returns a number to be used as percentage (so full value is 100) |
| 72 float valueAsPercentage100() const; | 72 float valueAsPercentage100() const; |
| 73 | 73 |
| 74 // Scale the input value by this SVGLength. Higher precision than input * va
lueAsPercentage(). | 74 // Scale the input value by this SVGLength. Higher precision than input * va
lueAsPercentage(). |
| 75 float scaleByPercentage(float) const; | 75 float scaleByPercentage(float) const; |
| 76 | 76 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 95 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, SVGPropertyBase* from, SVGPropertyBase* to, SVGPropertyBase* toAtE
ndOfDurationValue, SVGElement* contextElement) override; | 95 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, SVGPropertyBase* from, SVGPropertyBase* to, SVGPropertyBase* toAtE
ndOfDurationValue, SVGElement* contextElement) override; |
| 96 float calculateDistance(SVGPropertyBase* to, SVGElement* contextElement) ove
rride; | 96 float calculateDistance(SVGPropertyBase* to, SVGElement* contextElement) ove
rride; |
| 97 | 97 |
| 98 static AnimatedPropertyType classType() { return AnimatedLength; } | 98 static AnimatedPropertyType classType() { return AnimatedLength; } |
| 99 AnimatedPropertyType type() const override { return classType(); } | 99 AnimatedPropertyType type() const override { return classType(); } |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 SVGLength(SVGLengthMode); | 102 SVGLength(SVGLengthMode); |
| 103 SVGLength(const SVGLength&); | 103 SVGLength(const SVGLength&); |
| 104 | 104 |
| 105 Member<CSSPrimitiveValue> m_value; | 105 Member<const CSSPrimitiveValue> m_value; |
| 106 unsigned m_unitMode : 2; | 106 unsigned m_unitMode : 2; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); | 109 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); |
| 110 | 110 |
| 111 } // namespace blink | 111 } // namespace blink |
| 112 | 112 |
| 113 #endif // SVGLength_h | 113 #endif // SVGLength_h |
| OLD | NEW |