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

Side by Side Diff: Source/core/rendering/svg/RenderSVGInlineText.cpp

Issue 18309003: Inroduce toSVGInlineTextBox, and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/rendering/svg/SVGInlineFlowBox.cpp » ('j') | 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) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> 5 * Copyright (C) 2008 Rob Buis <buis@kde.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 float closestDistance = std::numeric_limits<float>::max(); 172 float closestDistance = std::numeric_limits<float>::max();
173 float closestDistancePosition = 0; 173 float closestDistancePosition = 0;
174 const SVGTextFragment* closestDistanceFragment = 0; 174 const SVGTextFragment* closestDistanceFragment = 0;
175 SVGInlineTextBox* closestDistanceBox = 0; 175 SVGInlineTextBox* closestDistanceBox = 0;
176 176
177 AffineTransform fragmentTransform; 177 AffineTransform fragmentTransform;
178 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 178 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
179 if (!box->isSVGInlineTextBox()) 179 if (!box->isSVGInlineTextBox())
180 continue; 180 continue;
181 181
182 SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(box); 182 SVGInlineTextBox* textBox = toSVGInlineTextBox(box);
183 Vector<SVGTextFragment>& fragments = textBox->textFragments(); 183 Vector<SVGTextFragment>& fragments = textBox->textFragments();
184 184
185 unsigned textFragmentsSize = fragments.size(); 185 unsigned textFragmentsSize = fragments.size();
186 for (unsigned i = 0; i < textFragmentsSize; ++i) { 186 for (unsigned i = 0; i < textFragmentsSize; ++i) {
187 const SVGTextFragment& fragment = fragments.at(i); 187 const SVGTextFragment& fragment = fragments.at(i);
188 FloatRect fragmentRect(fragment.x, fragment.y - baseline, fragment.w idth, fragment.height); 188 FloatRect fragmentRect(fragment.x, fragment.y - baseline, fragment.w idth, fragment.height);
189 fragment.buildFragmentTransform(fragmentTransform); 189 fragment.buildFragmentTransform(fragmentTransform);
190 if (!fragmentTransform.isIdentity()) 190 if (!fragmentTransform.isIdentity())
191 fragmentRect = fragmentTransform.mapRect(fragmentRect); 191 fragmentRect = fragmentTransform.mapRect(fragmentRect);
192 192
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 FontDescription fontDescription(style->fontDescription()); 236 FontDescription fontDescription(style->fontDescription());
237 237
238 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt). 238 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt).
239 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(d ocument, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.comput edSize(), DoNotUseSmartMinimumForFontSize)); 239 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(d ocument, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.comput edSize(), DoNotUseSmartMinimumForFontSize));
240 240
241 scaledFont = Font(fontDescription, 0, 0); 241 scaledFont = Font(fontDescription, 0, 0);
242 scaledFont.update(styleResolver->fontSelector()); 242 scaledFont.update(styleResolver->fontSelector());
243 } 243 }
244 244
245 } 245 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/svg/SVGInlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698