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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 ASSERT(value->primitiveType() == CSSPrimitiveValue::CSS_PC); | 323 ASSERT(value->primitiveType() == CSSPrimitiveValue::CSS_PC); |
324 svgType = LengthTypePC; | 324 svgType = LengthTypePC; |
325 break; | 325 break; |
326 }; | 326 }; |
327 | 327 |
328 RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create(); | 328 RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create(); |
329 length->newValueSpecifiedUnits(svgType, value->getFloatValue()); | 329 length->newValueSpecifiedUnits(svgType, value->getFloatValue()); |
330 return length.release(); | 330 return length.release(); |
331 } | 331 } |
332 | 332 |
333 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> SVGLength::toCSSPrimitiveValue(PassRef
PtrWillBeRawPtr<SVGLength> passLength) | 333 CSSPrimitiveValue SVGLength::toCSSPrimitiveValue(PassRefPtrWillBeRawPtr<SVGLengt
h> passLength) |
334 { | 334 { |
335 RefPtrWillBeRawPtr<SVGLength> length = passLength; | 335 RefPtrWillBeRawPtr<SVGLength> length = passLength; |
336 | 336 |
337 CSSPrimitiveValue::UnitType cssType = CSSPrimitiveValue::CSS_UNKNOWN; | 337 CSSPrimitiveValue::UnitType cssType = CSSPrimitiveValue::CSS_UNKNOWN; |
338 switch (length->unitType()) { | 338 switch (length->unitType()) { |
339 case LengthTypeUnknown: | 339 case LengthTypeUnknown: |
340 break; | 340 break; |
341 case LengthTypeNumber: | 341 case LengthTypeNumber: |
342 cssType = CSSPrimitiveValue::CSS_NUMBER; | 342 cssType = CSSPrimitiveValue::CSS_NUMBER; |
343 break; | 343 break; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 | 484 |
485 float SVGLength::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> toVal
ue, SVGElement* contextElement) | 485 float SVGLength::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> toVal
ue, SVGElement* contextElement) |
486 { | 486 { |
487 SVGLengthContext lengthContext(contextElement); | 487 SVGLengthContext lengthContext(contextElement); |
488 RefPtrWillBeRawPtr<SVGLength> toLength = toSVGLength(toValue); | 488 RefPtrWillBeRawPtr<SVGLength> toLength = toSVGLength(toValue); |
489 | 489 |
490 return fabsf(toLength->value(lengthContext) - value(lengthContext)); | 490 return fabsf(toLength->value(lengthContext) - value(lengthContext)); |
491 } | 491 } |
492 | 492 |
493 } | 493 } |
OLD | NEW |