| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void setValue(float, const SVGLengthContext&); | 61 void setValue(float, const SVGLengthContext&); |
| 62 void setValueAsNumber(float); | 62 void setValueAsNumber(float); |
| 63 | 63 |
| 64 float valueInSpecifiedUnits() const { return m_value->getFloatValue(); } | 64 float valueInSpecifiedUnits() const { return m_value->getFloatValue(); } |
| 65 void setValueInSpecifiedUnits(float value) { | 65 void setValueInSpecifiedUnits(float value) { |
| 66 m_value = CSSPrimitiveValue::create(value, m_value->typeWithCalcResolved()); | 66 m_value = CSSPrimitiveValue::create(value, m_value->typeWithCalcResolved()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 const CSSPrimitiveValue* asCSSPrimitiveValue() const { return m_value.get(); } | 69 const CSSPrimitiveValue* asCSSPrimitiveValue() const { return m_value.get(); } |
| 70 | 70 |
| 71 // Resolves LengthTypePercentage into a normalized floating point number (full
value is 1.0). | 71 // Resolves LengthTypePercentage into a normalized floating point number (full |
| 72 // value is 1.0). |
| 72 float valueAsPercentage() const; | 73 float valueAsPercentage() const; |
| 73 | 74 |
| 74 // Returns a number to be used as percentage (so full value is 100) | 75 // Returns a number to be used as percentage (so full value is 100) |
| 75 float valueAsPercentage100() const; | 76 float valueAsPercentage100() const; |
| 76 | 77 |
| 77 // Scale the input value by this SVGLength. Higher precision than input * valu
eAsPercentage(). | 78 // Scale the input value by this SVGLength. Higher precision than input * |
| 79 // valueAsPercentage(). |
| 78 float scaleByPercentage(float) const; | 80 float scaleByPercentage(float) const; |
| 79 | 81 |
| 80 String valueAsString() const override; | 82 String valueAsString() const override; |
| 81 SVGParsingError setValueAsString(const String&); | 83 SVGParsingError setValueAsString(const String&); |
| 82 | 84 |
| 83 void newValueSpecifiedUnits(CSSPrimitiveValue::UnitType, | 85 void newValueSpecifiedUnits(CSSPrimitiveValue::UnitType, |
| 84 float valueInSpecifiedUnits); | 86 float valueInSpecifiedUnits); |
| 85 void convertToSpecifiedUnits(CSSPrimitiveValue::UnitType, | 87 void convertToSpecifiedUnits(CSSPrimitiveValue::UnitType, |
| 86 const SVGLengthContext&); | 88 const SVGLengthContext&); |
| 87 | 89 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 118 | 120 |
| 119 Member<const CSSPrimitiveValue> m_value; | 121 Member<const CSSPrimitiveValue> m_value; |
| 120 unsigned m_unitMode : 2; | 122 unsigned m_unitMode : 2; |
| 121 }; | 123 }; |
| 122 | 124 |
| 123 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); | 125 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); |
| 124 | 126 |
| 125 } // namespace blink | 127 } // namespace blink |
| 126 | 128 |
| 127 #endif // SVGLength_h | 129 #endif // SVGLength_h |
| OLD | NEW |