OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 { | 70 { |
71 return m_unitMode == other.m_unitMode && m_value == other.m_value; | 71 return m_unitMode == other.m_unitMode && m_value == other.m_value; |
72 } | 72 } |
73 | 73 |
74 float SVGLength::value(const SVGLengthContext& context) const | 74 float SVGLength::value(const SVGLengthContext& context) const |
75 { | 75 { |
76 return context.convertValueToUserUnits( | 76 return context.convertValueToUserUnits( |
77 m_value->getFloatValue(), unitMode(), m_value->typeWithCalcResolved()); | 77 m_value->getFloatValue(), unitMode(), m_value->typeWithCalcResolved()); |
78 } | 78 } |
79 | 79 |
80 void SVGLength::setValue(float value, const SVGLengthContext& context) | 80 void SVGLength::setValue(float value, const SVGLengthContext& context) |
fs
2016/07/01 09:08:05
This method is used in a few more places besides S
Shanmuga Pandi
2016/07/01 10:27:13
Done.
| |
81 { | 81 { |
82 m_value = CSSPrimitiveValue::create( | 82 m_value = CSSPrimitiveValue::create(value, CSSPrimitiveValue::UnitType::User Units); |
83 context.convertValueFromUserUnits(value, unitMode(), m_value->typeWithCa lcResolved()), | |
84 m_value->typeWithCalcResolved()); | |
85 } | 83 } |
86 | 84 |
87 bool isSupportedCSSUnitType(CSSPrimitiveValue::UnitType type) | 85 bool isSupportedCSSUnitType(CSSPrimitiveValue::UnitType type) |
88 { | 86 { |
89 return (CSSPrimitiveValue::isLength(type) || type == CSSPrimitiveValue::Unit Type::Number || type == CSSPrimitiveValue::UnitType::Percentage) | 87 return (CSSPrimitiveValue::isLength(type) || type == CSSPrimitiveValue::Unit Type::Number || type == CSSPrimitiveValue::UnitType::Percentage) |
90 && type != CSSPrimitiveValue::UnitType::QuirkyEms; | 88 && type != CSSPrimitiveValue::UnitType::QuirkyEms; |
91 } | 89 } |
92 | 90 |
93 void SVGLength::setUnitType(CSSPrimitiveValue::UnitType type) | 91 void SVGLength::setUnitType(CSSPrimitiveValue::UnitType type) |
94 { | 92 { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 | 254 |
257 float SVGLength::calculateDistance(SVGPropertyBase* toValue, SVGElement* context Element) | 255 float SVGLength::calculateDistance(SVGPropertyBase* toValue, SVGElement* context Element) |
258 { | 256 { |
259 SVGLengthContext lengthContext(contextElement); | 257 SVGLengthContext lengthContext(contextElement); |
260 SVGLength* toLength = toSVGLength(toValue); | 258 SVGLength* toLength = toSVGLength(toValue); |
261 | 259 |
262 return fabsf(toLength->value(lengthContext) - value(lengthContext)); | 260 return fabsf(toLength->value(lengthContext) - value(lengthContext)); |
263 } | 261 } |
264 | 262 |
265 } // namespace blink | 263 } // namespace blink |
OLD | NEW |