Fix strikethrough halo width not being set on the correct paint object (#60)
This commit is contained in:
Родитель
a58c8b0606
Коммит
13cf92d80b
|
@ -731,12 +731,13 @@ namespace Topten.RichTextKit
|
|||
|
||||
if (Style.HaloColor != SKColor.Empty)
|
||||
{
|
||||
// Paint strikethrough
|
||||
// Paint strikethrough halo behind text
|
||||
if (Style.StrikeThrough != StrikeThroughStyle.None && RunKind == FontRunKind.Normal)
|
||||
{
|
||||
paint.StrokeWidth = _font.Metrics.StrikeoutThickness ?? 1;
|
||||
if (paint.StrokeWidth < 1)
|
||||
paint.StrokeWidth = 1; ;
|
||||
paintHalo.StrokeWidth = _font.Metrics.StrikeoutThickness ?? 1;
|
||||
if (paintHalo.StrokeWidth < 1)
|
||||
paintHalo.StrokeWidth = 1;
|
||||
paintHalo.StrokeWidth += Style.HaloWidth;
|
||||
float strikeYPos = Line.YCoord + Line.BaseLine + (_font.Metrics.StrikeoutPosition ?? 0) + glyphVOffset;
|
||||
ctx.Canvas.DrawLine(new SKPoint(XCoord, strikeYPos), new SKPoint(XCoord + Width, strikeYPos), paintHalo);
|
||||
}
|
||||
|
@ -747,12 +748,12 @@ namespace Topten.RichTextKit
|
|||
}
|
||||
}
|
||||
|
||||
// Paint strikethrough
|
||||
// Paint strikethrough above text
|
||||
if (Style.StrikeThrough != StrikeThroughStyle.None && RunKind == FontRunKind.Normal)
|
||||
{
|
||||
paint.StrokeWidth = _font.Metrics.StrikeoutThickness ?? 1;
|
||||
if (paint.StrokeWidth < 1)
|
||||
paint.StrokeWidth = 1; ;
|
||||
paint.StrokeWidth = 1;
|
||||
float strikeYPos = Line.YCoord + Line.BaseLine + (_font.Metrics.StrikeoutPosition ?? 0) + glyphVOffset;
|
||||
ctx.Canvas.DrawLine(new SKPoint(XCoord, strikeYPos), new SKPoint(XCoord + Width, strikeYPos), paint);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче