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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.h

Issue 2331783002: Fix tab is invisible when the next stop is close (Closed)
Patch Set: Cleanup Created 4 years, 3 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
Index: third_party/WebKit/Source/platform/fonts/Font.h
diff --git a/third_party/WebKit/Source/platform/fonts/Font.h b/third_party/WebKit/Source/platform/fonts/Font.h
index 322c1c5ef4b2ac5dc544a4901875d3c6165d0546..9918b1ee8392d7c9cd8893b09324501dfdf89b14 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.h
+++ b/third_party/WebKit/Source/platform/fonts/Font.h
@@ -194,9 +194,9 @@ inline float Font::tabWidth(const SimpleFontData& fontData, const TabSize& tabSi
return getFontDescription().letterSpacing();
float distanceToTabStop = baseTabWidth - fmodf(position, baseTabWidth);
- // The smallest allowable tab space is letterSpacing() (but must be at least one layout unit).
+ // Let the minimum width be the half of the space width so that it's always recognizable.
// if the distance to the next tab stop is less than that, advance an additional tab stop.
- if (distanceToTabStop < std::max(getFontDescription().letterSpacing(), LayoutUnit::epsilon()))
+ if (distanceToTabStop < fontData.spaceWidth() / 2)
distanceToTabStop += baseTabWidth;
return distanceToTabStop;

Powered by Google App Engine
This is Rietveld 408576698