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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 float value(const SVGLengthContext& context) const | 62 float value(const SVGLengthContext& context) const |
63 { | 63 { |
64 return value(context, IGNORE_EXCEPTION); | 64 return value(context, IGNORE_EXCEPTION); |
65 } | 65 } |
66 float value(const SVGLengthContext&, ExceptionState&) const; | 66 float value(const SVGLengthContext&, ExceptionState&) const; |
67 void setValue(float, const SVGLengthContext&, ExceptionState&); | 67 void setValue(float, const SVGLengthContext&, ExceptionState&); |
68 | 68 |
69 float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; } | 69 float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; } |
70 void setValueInSpecifiedUnits(float value) { m_valueInSpecifiedUnits = value
; } | 70 void setValueInSpecifiedUnits(float value) { m_valueInSpecifiedUnits = value
; } |
71 | 71 |
| 72 // Resolves LengthTypePercentage into a normalized floating point number (fu
ll value is 1.0). |
72 float valueAsPercentage() const; | 73 float valueAsPercentage() const; |
73 | 74 |
| 75 // Returns a number to be used as percentage (so full value is 100) |
| 76 float valueAsPercentage100() const; |
| 77 |
| 78 // Scale the input value by this SVGLength. Higher precision than input * va
lueAsPercentage(). |
| 79 float scaleByPercentage(float) const; |
| 80 |
74 virtual String valueAsString() const override; | 81 virtual String valueAsString() const override; |
75 void setValueAsString(const String&, ExceptionState&); | 82 void setValueAsString(const String&, ExceptionState&); |
76 | 83 |
77 void newValueSpecifiedUnits(SVGLengthType, float valueInSpecifiedUnits); | 84 void newValueSpecifiedUnits(SVGLengthType, float valueInSpecifiedUnits); |
78 void convertToSpecifiedUnits(SVGLengthType, const SVGLengthContext&, Excepti
onState&); | 85 void convertToSpecifiedUnits(SVGLengthType, const SVGLengthContext&, Excepti
onState&); |
79 | 86 |
80 // Helper functions | 87 // Helper functions |
81 inline bool isRelative() const | 88 inline bool isRelative() const |
82 { | 89 { |
83 return m_unitType == LengthTypePercentage | 90 return m_unitType == LengthTypePercentage |
(...skipping 30 matching lines...) Expand all Loading... |
114 inline PassRefPtrWillBeRawPtr<SVGLength> toSVGLength(PassRefPtrWillBeRawPtr<SVGP
ropertyBase> passBase) | 121 inline PassRefPtrWillBeRawPtr<SVGLength> toSVGLength(PassRefPtrWillBeRawPtr<SVGP
ropertyBase> passBase) |
115 { | 122 { |
116 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; | 123 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; |
117 ASSERT(base->type() == SVGLength::classType()); | 124 ASSERT(base->type() == SVGLength::classType()); |
118 return static_pointer_cast<SVGLength>(base.release()); | 125 return static_pointer_cast<SVGLength>(base.release()); |
119 } | 126 } |
120 | 127 |
121 } // namespace blink | 128 } // namespace blink |
122 | 129 |
123 #endif // SVGLength_h | 130 #endif // SVGLength_h |
OLD | NEW |