Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp

Issue 1730523002: Clean up variable usage on LayoutSVGRoot::positionForPoint function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 PositionWithAffinity LayoutSVGRoot::positionForPoint(const LayoutPoint& point) 280 PositionWithAffinity LayoutSVGRoot::positionForPoint(const LayoutPoint& point)
281 { 281 {
282 FloatPoint absolutePoint = FloatPoint(point); 282 FloatPoint absolutePoint = FloatPoint(point);
283 absolutePoint = m_localToBorderBoxTransform.inverse().mapPoint(absolutePoint ); 283 absolutePoint = m_localToBorderBoxTransform.inverse().mapPoint(absolutePoint );
284 LayoutObject* closestDescendant = SVGLayoutSupport::findClosestLayoutSVGText (this, absolutePoint); 284 LayoutObject* closestDescendant = SVGLayoutSupport::findClosestLayoutSVGText (this, absolutePoint);
285 285
286 if (!closestDescendant) 286 if (!closestDescendant)
287 return LayoutReplaced::positionForPoint(point); 287 return LayoutReplaced::positionForPoint(point);
288 288
289 LayoutObject* layoutObject = closestDescendant; 289 LayoutObject* layoutObject = closestDescendant;
290 AffineTransform transform = closestDescendant->localToParentTransform(); 290 AffineTransform transform = layoutObject->localToParentTransform();
291 transform.translate(toLayoutSVGText(closestDescendant)->location().x(), toLa youtSVGText(closestDescendant)->location().y()); 291 transform.translate(toLayoutSVGText(layoutObject)->location().x(), toLayoutS VGText(layoutObject)->location().y());
292 while (layoutObject) { 292 while (layoutObject) {
293 layoutObject = layoutObject->parent(); 293 layoutObject = layoutObject->parent();
294 if (layoutObject->isSVGRoot()) 294 if (layoutObject->isSVGRoot())
295 break; 295 break;
296 transform = layoutObject->localToParentTransform() * transform; 296 transform = layoutObject->localToParentTransform() * transform;
297 } 297 }
298 298
299 absolutePoint = transform.inverse().mapPoint(absolutePoint); 299 absolutePoint = transform.inverse().mapPoint(absolutePoint);
300 300
301 return closestDescendant->positionForPoint(LayoutPoint(absolutePoint)); 301 return closestDescendant->positionForPoint(LayoutPoint(absolutePoint));
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 updateHitTestResult(result, pointInBorderBox); 429 updateHitTestResult(result, pointInBorderBox);
430 if (result.addNodeToListBasedTestResult(node(), locationInContainer, boundsRect) == StopHitTesting) 430 if (result.addNodeToListBasedTestResult(node(), locationInContainer, boundsRect) == StopHitTesting)
431 return true; 431 return true;
432 } 432 }
433 } 433 }
434 434
435 return false; 435 return false;
436 } 436 }
437 437
438 } // namespace blink 438 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698