未验证 提交 e85d9219 编写于 作者: F Ferhat 提交者: GitHub

Fix single line bitmap canvas text shadow (#13901)

上级 dd77b73d
......@@ -165,7 +165,8 @@ class EngineParagraph implements ui.Paragraph {
} else {
canDrawTextOnCanvas = _measurementResult.isSingleLine &&
_plainText != null &&
_geometricStyle.ellipsis == null;
_geometricStyle.ellipsis == null &&
_geometricStyle.shadows == null;
}
return canDrawTextOnCanvas &&
......@@ -364,7 +365,9 @@ class EngineParagraphStyle implements ui.ParagraphStyle {
double get _lineHeight {
// TODO(mdebbar): Implement proper support for strut styles.
// https://github.com/flutter/flutter/issues/32243
if (_strutStyle == null || _strutStyle._height == null || _strutStyle._height == 0) {
if (_strutStyle == null ||
_strutStyle._height == null ||
_strutStyle._height == 0) {
// When there's no strut height, always use paragraph style height.
return _height;
}
......@@ -908,6 +911,7 @@ class EngineParagraphBuilder implements ui.ParagraphBuilder {
wordSpacing: wordSpacing,
decoration: _textDecorationToCssString(decoration, decorationStyle),
ellipsis: _paragraphStyle._ellipsis,
shadows: shadows,
),
plainText: '',
paint: paint,
......@@ -961,6 +965,7 @@ class EngineParagraphBuilder implements ui.ParagraphBuilder {
wordSpacing: wordSpacing,
decoration: _textDecorationToCssString(decoration, decorationStyle),
ellipsis: _paragraphStyle._ellipsis,
shadows: shadows,
),
plainText: plainText,
paint: paint,
......
......@@ -17,6 +17,7 @@ class ParagraphGeometricStyle {
this.wordSpacing,
this.decoration,
this.ellipsis,
this.shadows,
});
final ui.FontWeight fontWeight;
......@@ -29,6 +30,7 @@ class ParagraphGeometricStyle {
final double wordSpacing;
final String decoration;
final String ellipsis;
final List<ui.Shadow> shadows;
// Since all fields above are primitives, cache hashcode since ruler lookups
// use this style as key.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册