| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 // RenderBox methods will expect coordinates w/o any transforms in coordinates | 330 // RenderBox methods will expect coordinates w/o any transforms in coordinates |
| 331 // relative to our borderBox origin. This method gives us exactly that. | 331 // relative to our borderBox origin. This method gives us exactly that. |
| 332 void RenderSVGRoot::buildLocalToBorderBoxTransform() | 332 void RenderSVGRoot::buildLocalToBorderBoxTransform() |
| 333 { | 333 { |
| 334 SVGSVGElement* svg = toSVGSVGElement(node()); | 334 SVGSVGElement* svg = toSVGSVGElement(node()); |
| 335 ASSERT(svg); | 335 ASSERT(svg); |
| 336 float scale = style()->effectiveZoom(); | 336 float scale = style()->effectiveZoom(); |
| 337 FloatPoint translate = svg->currentTranslate(); | 337 FloatPoint translate = svg->currentTranslate(); |
| 338 LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + padd
ingTop()); | 338 LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + padd
ingTop()); |
| 339 m_localToBorderBoxTransform = svg->viewBoxToViewTransform(contentWidth() / s
cale, contentHeight() / scale); | 339 m_localToBorderBoxTransform = svg->viewBoxToViewTransform(contentWidth() / s
cale, contentHeight() / scale); |
| 340 if (borderAndPadding.isEmpty() && scale == 1 && translate == FloatPoint::zer
o()) | 340 AffineTransform viewToBorderBoxTransform(scale, 0, 0, scale, borderAndPaddin
g.width() + translate.x(), borderAndPadding.height() + translate.y()); |
| 341 if (viewToBorderBoxTransform.isIdentity()) |
| 341 return; | 342 return; |
| 342 m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndP
adding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_l
ocalToBorderBoxTransform; | 343 m_localToBorderBoxTransform = viewToBorderBoxTransform * m_localToBorderBoxT
ransform; |
| 343 } | 344 } |
| 344 | 345 |
| 345 const AffineTransform& RenderSVGRoot::localToParentTransform() const | 346 const AffineTransform& RenderSVGRoot::localToParentTransform() const |
| 346 { | 347 { |
| 347 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; | 348 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; |
| 348 m_localToParentTransform = m_localToBorderBoxTransform; | 349 m_localToParentTransform = m_localToBorderBoxTransform; |
| 349 if (x()) | 350 if (x()) |
| 350 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); | 351 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); |
| 351 if (y()) | 352 if (y()) |
| 352 m_localToParentTransform.setF(m_localToParentTransform.f() + roundToInt(
y())); | 353 m_localToParentTransform.setF(m_localToParentTransform.f() + roundToInt(
y())); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 updateHitTestResult(result, pointInBorderBox); | 458 updateHitTestResult(result, pointInBorderBox); |
| 458 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn
Container, boundsRect)) | 459 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn
Container, boundsRect)) |
| 459 return true; | 460 return true; |
| 460 } | 461 } |
| 461 } | 462 } |
| 462 | 463 |
| 463 return false; | 464 return false; |
| 464 } | 465 } |
| 465 | 466 |
| 466 } | 467 } |
| OLD | NEW |