OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
9 * Copyright (C) 2012 Google Inc. | 9 * Copyright (C) 2012 Google Inc. |
10 * | 10 * |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 | 445 |
446 return false; | 446 return false; |
447 } | 447 } |
448 | 448 |
449 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents) | 449 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents) |
450 { | 450 { |
451 RootInlineBox* rootBox = firstRootBox(); | 451 RootInlineBox* rootBox = firstRootBox(); |
452 if (!rootBox) | 452 if (!rootBox) |
453 return createPositionWithAffinity(0); | 453 return createPositionWithAffinity(0); |
454 | 454 |
455 FloatPoint absolutePoint(pointInContents); | |
fs
2016/01/19 13:30:04
Maybe call this "clippedPointInContents" or someth
| |
456 if (absolutePoint.x() < 0) | |
fs
2016/01/19 13:30:04
This operation would be the same as LayoutPoint::c
| |
457 absolutePoint.setX(0); | |
458 if (absolutePoint.y() < 0) | |
459 absolutePoint.setY(0); | |
460 | |
455 ASSERT(!rootBox->nextRootBox()); | 461 ASSERT(!rootBox->nextRootBox()); |
456 ASSERT(childrenInline()); | 462 ASSERT(childrenInline()); |
457 | 463 |
458 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi tion(pointInContents); | 464 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi tion(LayoutPoint(absolutePoint)); |
459 if (!closestBox) | 465 if (!closestBox) |
460 return createPositionWithAffinity(0); | 466 return createPositionWithAffinity(0); |
461 | 467 |
462 return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(pointInCont ents.x(), closestBox->y())); | 468 return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(absolutePoi nt.x(), closestBox->y())); |
463 } | 469 } |
464 | 470 |
465 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) cons t | 471 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) cons t |
466 { | 472 { |
467 quads.append(localToAbsoluteQuad(strokeBoundingBox(), 0 /* mode */, wasFixed )); | 473 quads.append(localToAbsoluteQuad(strokeBoundingBox(), 0 /* mode */, wasFixed )); |
468 } | 474 } |
469 | 475 |
470 void LayoutSVGText::paint(const PaintInfo& paintInfo, const LayoutPoint&) const | 476 void LayoutSVGText::paint(const PaintInfo& paintInfo, const LayoutPoint&) const |
471 { | 477 { |
472 SVGTextPainter(*this).paint(paintInfo); | 478 SVGTextPainter(*this).paint(paintInfo); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 536 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
531 | 537 |
532 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState); | 538 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState); |
533 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, pai ntInvalidationState.paintInvalidationContainer()); | 539 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, pai ntInvalidationState.paintInvalidationContainer()); |
534 if (reason == PaintInvalidationSVGResourceChange) | 540 if (reason == PaintInvalidationSVGResourceChange) |
535 childTreeWalkState.setForceSubtreeInvalidationWithinContainer(); | 541 childTreeWalkState.setForceSubtreeInvalidationWithinContainer(); |
536 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); | 542 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); |
537 } | 543 } |
538 | 544 |
539 } | 545 } |
OLD | NEW |