| 41 | if (customUnderlineStyle) { |
| 42 | paint.setStroke(true); |
| 43 | paint.setStrokeWidth(customUnderlineStyle->height); |
| 44 | paint.setStrokeCap(PaintStrokeCapButt); |
| 45 | if (customUnderlineStyle->isPatterned()) { |
| 46 | paint.setStrokeDashPattern(customUnderlineStyle->onWidth, customUnderlineStyle->offWidth); |
| 47 | } |
| 48 | |
| 49 | auto path = makeTextDecorationPath(bounds); |
| 50 | drawingContext.drawPaint(paint, path); |
| 51 | } else if (style == TextLayoutDecorationStyleDashed) { |
| 52 | auto strokeWidth = std::max<Scalar>(bounds.height(), 1.0f); |
| 53 | paint.setStroke(true); |
| 54 | paint.setStrokeWidth(strokeWidth); |
| 55 | paint.setStrokeCap(PaintStrokeCapButt); |
| 56 | paint.setStrokeDashPattern(strokeWidth * 3.0f, strokeWidth * 2.0f); |
| 57 | |
| 58 | auto path = makeTextDecorationPath(bounds); |
| 59 | drawingContext.drawPaint(paint, path); |
| 60 | } else if (style == TextLayoutDecorationStyleDotted) { |
| 61 | auto strokeWidth = std::max<Scalar>(bounds.height(), 1.0f); |
| 62 | paint.setStroke(false); |
| 63 | paint.setStrokeDotPattern(strokeWidth / 2.0f, strokeWidth * 2.0f); |
| 64 | |
| 65 | auto path = makeTextDecorationPath(bounds); |
| 66 | drawingContext.drawPaint(paint, path); |
| 67 | } else { |
| 68 | drawingContext.drawPaint(paint, bounds); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | TextLayer::TextLayer(const Ref<Resources>& resources) : Layer(resources) { |
| 73 | _textPaint.setAntiAlias(true); |
| 74 | _gradientWrapper = GradientWrapper(); |
| 75 | } |
| 76 |
nothing calls this directly
no test coverage detected