Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/SVGTextChunkBuilder.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextChunkBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextChunkBuilder.cpp |
| index 2aa34f70a4bf3c22f351e1a52572fffa320e0ee6..59387e98c321453416c465a0e61437c96abe0abf 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/SVGTextChunkBuilder.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGTextChunkBuilder.cpp |
| @@ -208,8 +208,11 @@ void SVGTextChunkBuilder::HandleTextChunk(BoxListConstIterator box_start, |
| if (process_text_length) { |
| float chunk_length = length_accumulator.length(); |
| if (length_adjust == kSVGLengthAdjustSpacing) { |
| - float text_length_shift = (desired_text_length - chunk_length) / |
| - length_accumulator.NumCharacters(); |
|
fs
2017/05/10 16:06:10
When I had finished this I remembered/noticed that
|
| + float text_length_shift = 0; |
| + if (length_accumulator.NumCharacters() > 1) { |
| + text_length_shift = desired_text_length - chunk_length; |
| + text_length_shift /= length_accumulator.NumCharacters() - 1; |
| + } |
| unsigned at_character = 0; |
| for (auto box_iter = box_start; box_iter != box_end; ++box_iter) { |
| Vector<SVGTextFragment>& fragments = (*box_iter)->TextFragments(); |