Skip to content

Commit ec0e562

Browse files
committed
fix opacity of fill
1 parent 4a37511 commit ec0e562

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Source/SVGImage/SVG/PaintServer/SolidColorPaintServer.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ public SolidColorPaintServer(PaintServerManager owner, Brush newBrush) : base(ow
2020

2121
public override Brush GetBrush(double opacity, SVG svg, SVGRender svgRender, Rect bounds)
2222
{
23-
if (Brush != null) return Brush;
2423
byte a = (byte)(255 * opacity / 100);
24+
if (Brush != null && Brush is SolidColorBrush s)
25+
{
26+
if (opacity < 100)
27+
{
28+
return new SolidColorBrush(Color.FromArgb(a, s.Color.R, s.Color.G, s.Color.B));
29+
}
30+
return Brush;
31+
}
2532
Color c = this.Color;
2633
Color newcol = Color.FromArgb(a, c.R, c.G, c.B);
2734
Brush = new SolidColorBrush(newcol);

0 commit comments

Comments
 (0)