WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP
bug-191893-20181121122618.patch (text/plain), 2.87 KB, created by
Myles C. Maxfield
on 2018-11-21 12:26:19 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2018-11-21 12:26:19 PST
Size:
2.87 KB
patch
obsolete
>Subversion Revision: 237989 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 218c09076c47856a141985d1f430b31f8f8e44fa..6b2f5f5597fb2622e6103626104e8394010a58eb 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-11-21 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ Thin underlines on large text have ink-skipping gaps that are ugly >+ https://bugs.webkit.org/show_bug.cgi?id=191893 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * rendering/TextDecorationPainter.cpp: >+ (WebCore::calculateDilationAmount): >+ (WebCore::TextDecorationPainter::paintTextDecoration): >+ > 2018-11-08 Jonathan Hammer <jonathan@e3software.com> > > Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove >diff --git a/Source/WebCore/rendering/TextDecorationPainter.cpp b/Source/WebCore/rendering/TextDecorationPainter.cpp >index bfc9ee5ae5054e5b0d3c93d997309b77308d4e47..75456e8c34085ae94e491d3751a4a8ad3391aade 100644 >--- a/Source/WebCore/rendering/TextDecorationPainter.cpp >+++ b/Source/WebCore/rendering/TextDecorationPainter.cpp >@@ -208,6 +208,13 @@ TextDecorationPainter::TextDecorationPainter(GraphicsContext& context, OptionSet > { > } > >+static float calculateDilationAmount(float thickness, float fontSize) >+{ >+ // Hyperbola, where small thicknesses still get a noticeable px gap, but for larger values it scales linearly. >+ auto x = (thickness + fontSize / 16) / 2 * 1.3; >+ return std::sqrt(x * x + 4 * 4); >+} >+ > void TextDecorationPainter::paintTextDecoration(const TextRun& textRun, const FloatPoint& textOrigin, const FloatPoint& boxOrigin) > { > const auto& fontMetrics = m_lineStyle.fontMetrics(); >@@ -226,7 +233,8 @@ void TextDecorationPainter::paintTextDecoration(const TextRun& textRun, const Fl > if (!m_context.paintingDisabled()) { > FloatRect underlineBoundingBox = m_context.computeUnderlineBoundsForText(rect, m_isPrinting); > DashArray intersections = m_font.dashesForIntersectionsWithRect(textRun, textOrigin, underlineBoundingBox); >- DashArray boundaries = translateIntersectionPointsToSkipInkBoundaries(intersections, underlineBoundingBox.height(), rect.width()); >+ auto dilationAmount = calculateDilationAmount(underlineBoundingBox.height(), m_lineStyle.computedFontSize()); >+ DashArray boundaries = translateIntersectionPointsToSkipInkBoundaries(intersections, dilationAmount, rect.width()); > ASSERT(!(boundaries.size() % 2)); > // We don't use underlineBoundingBox here because drawLinesForText() will run computeUnderlineBoundsForText() internally. > m_context.drawLinesForText(rect.location(), rect.height(), boundaries, m_isPrinting, style == TextDecorationStyle::Double, strokeStyle);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191893
:
355433
|
355434