RenderSVGTSpan.cpp [plain text]
#include "config.h"
#if ENABLE(SVG)
#include "RenderSVGTSpan.h"
#include "FloatRect.h"
#include "SVGInlineTextBox.h"
#include "SVGRootInlineBox.h"
namespace WebCore {
RenderSVGTSpan::RenderSVGTSpan(Node* n)
: RenderSVGInline(n)
{
}
void RenderSVGTSpan::absoluteRects(Vector<IntRect>& rects, int, int, bool)
{
InlineRunBox* firstBox = firstLineBox();
SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
RenderObject* object = rootBox ? rootBox->object() : 0;
if (!object)
return;
int xRef = object->xPos() + xPos();
int yRef = object->yPos() + yPos();
for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
FloatRect rect(xRef + curr->xPos(), yRef + curr->yPos(), curr->width(), curr->height());
rects.append(enclosingIntRect(absoluteTransform().mapRect(rect)));
}
}
}
#endif // ENABLE(SVG)