Chromium Code Reviews| 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 if (borderAndPadding.isZero() && scale == 1 && translate == FloatPoint::zero ()) |
|
davve
2014/05/27 09:16:52
Nit: Would it perhaps be more readable if we inste
fs
2014/05/27 10:15:31
Certainly less error-prone at least (slightly more
| |
| 341 return; | 341 return; |
| 342 m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndP adding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_l ocalToBorderBoxTransform; | 342 m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndP adding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_l ocalToBorderBoxTransform; |
| 343 } | 343 } |
| 344 | 344 |
| 345 const AffineTransform& RenderSVGRoot::localToParentTransform() const | 345 const AffineTransform& RenderSVGRoot::localToParentTransform() const |
| 346 { | 346 { |
| 347 // Slightly optimized version of m_localToParentTransform = AffineTransform: :translation(x(), y()) * m_localToBorderBoxTransform; | 347 // Slightly optimized version of m_localToParentTransform = AffineTransform: :translation(x(), y()) * m_localToBorderBoxTransform; |
| 348 m_localToParentTransform = m_localToBorderBoxTransform; | 348 m_localToParentTransform = m_localToBorderBoxTransform; |
| 349 if (x()) | 349 if (x()) |
| 350 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt( x())); | 350 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt( x())); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 updateHitTestResult(result, pointInBorderBox); | 457 updateHitTestResult(result, pointInBorderBox); |
| 458 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn Container, boundsRect)) | 458 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn Container, boundsRect)) |
| 459 return true; | 459 return true; |
| 460 } | 460 } |
| 461 } | 461 } |
| 462 | 462 |
| 463 return false; | 463 return false; |
| 464 } | 464 } |
| 465 | 465 |
| 466 } | 466 } |
| OLD | NEW |