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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp

Issue 2868413003: Fix textPath textLength position adjustment for the spacing case (Closed)
Patch Set: Updated baselines Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textOnPathSpaces-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
index e5822beb80aafc9f2bec25eebb167531f5fd4e7e..20182a0461aff791bbb35d077f49c5fcf88689af 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
@@ -206,11 +206,16 @@ void SVGTextLayoutEngine::BeginTextPathLayout(SVGInlineFlowBox* flow_box) {
return;
float total_length = text_path_chunk_layout_builder.TotalLength();
- if (length_adjust == kSVGLengthAdjustSpacing)
- text_path_spacing_ = (desired_text_length - total_length) /
- text_path_chunk_layout_builder.TotalCharacters();
- else
+ if (length_adjust == kSVGLengthAdjustSpacing) {
+ text_path_spacing_ = 0;
+ if (text_path_chunk_layout_builder.TotalCharacters() > 1) {
+ text_path_spacing_ = desired_text_length - total_length;
+ text_path_spacing_ /=
+ text_path_chunk_layout_builder.TotalCharacters() - 1;
+ }
+ } else {
text_path_scaling_ = desired_text_length / total_length;
+ }
}
void SVGTextLayoutEngine::EndTextPathLayout() {
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textOnPathSpaces-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698