OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 RenderReplaced::willBeRemovedFromTree(); | 324 RenderReplaced::willBeRemovedFromTree(); |
325 } | 325 } |
326 | 326 |
327 // RenderBox methods will expect coordinates w/o any transforms in coordinates | 327 // RenderBox methods will expect coordinates w/o any transforms in coordinates |
328 // relative to our borderBox origin. This method gives us exactly that. | 328 // relative to our borderBox origin. This method gives us exactly that. |
329 void RenderSVGRoot::buildLocalToBorderBoxTransform() | 329 void RenderSVGRoot::buildLocalToBorderBoxTransform() |
330 { | 330 { |
331 SVGSVGElement* svg = toSVGSVGElement(node()); | 331 SVGSVGElement* svg = toSVGSVGElement(node()); |
332 ASSERT(svg); | 332 ASSERT(svg); |
333 float scale = style()->effectiveZoom(); | 333 float scale = style()->effectiveZoom(); |
334 SVGPoint translate = svg->currentTranslate(); | 334 FloatPoint translate = svg->currentTranslate(); |
335 LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + padd
ingTop()); | 335 LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + padd
ingTop()); |
336 m_localToBorderBoxTransform = svg->viewBoxToViewTransform(contentWidth() / s
cale, contentHeight() / scale); | 336 m_localToBorderBoxTransform = svg->viewBoxToViewTransform(contentWidth() / s
cale, contentHeight() / scale); |
337 if (borderAndPadding.isEmpty() && scale == 1 && translate == SVGPoint::zero(
)) | 337 if (borderAndPadding.isEmpty() && scale == 1 && translate == FloatPoint::zer
o()) |
338 return; | 338 return; |
339 m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndP
adding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_l
ocalToBorderBoxTransform; | 339 m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndP
adding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_l
ocalToBorderBoxTransform; |
340 } | 340 } |
341 | 341 |
342 const AffineTransform& RenderSVGRoot::localToParentTransform() const | 342 const AffineTransform& RenderSVGRoot::localToParentTransform() const |
343 { | 343 { |
344 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; | 344 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; |
345 m_localToParentTransform = m_localToBorderBoxTransform; | 345 m_localToParentTransform = m_localToBorderBoxTransform; |
346 if (x()) | 346 if (x()) |
347 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); | 347 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 bool RenderSVGRoot::hasRelativeLogicalHeight() const | 439 bool RenderSVGRoot::hasRelativeLogicalHeight() const |
440 { | 440 { |
441 SVGSVGElement* svg = toSVGSVGElement(node()); | 441 SVGSVGElement* svg = toSVGSVGElement(node()); |
442 ASSERT(svg); | 442 ASSERT(svg); |
443 | 443 |
444 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent(); | 444 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent(); |
445 } | 445 } |
446 | 446 |
447 } | 447 } |
OLD | NEW |