Default decoration color to text color.
Change-Id: I74f1ffc6372ccf952232e9dcbba66029c31a7088
This commit is contained in:
@@ -622,7 +622,11 @@ void Paragraph::PaintDecorations(SkCanvas* canvas,
|
||||
const SkPaint::FontMetrics& metrics = record.metrics();
|
||||
SkPaint paint;
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setColor(record.style().decoration_color);
|
||||
if (record.style().decoration_color == SK_ColorTRANSPARENT) {
|
||||
paint.setColor(record.style().color);
|
||||
} else {
|
||||
paint.setColor(record.style().decoration_color);
|
||||
}
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
// This is set to 2 for the double line style
|
||||
|
||||
@@ -31,7 +31,9 @@ class TextStyle {
|
||||
public:
|
||||
SkColor color = SK_ColorBLACK;
|
||||
TextDecoration decoration = TextDecoration::kNone;
|
||||
SkColor decoration_color = SK_ColorBLACK;
|
||||
// Does not make sense to draw a transparent object, so we use it as a default
|
||||
// value to indicate no decoration color was set.
|
||||
SkColor decoration_color = SK_ColorTRANSPARENT;
|
||||
TextDecorationStyle decoration_style = TextDecorationStyle::kSolid;
|
||||
double decoration_thickness = 1.0;
|
||||
FontWeight font_weight = FontWeight::w400;
|
||||
|
||||
Reference in New Issue
Block a user