Draw shadow even when border is not visible

This commit is contained in:
Jaex 2017-06-14 17:28:22 +03:00
parent f4bd3e270f
commit 038575582a
3 changed files with 27 additions and 6 deletions

View file

@ -40,9 +40,16 @@ public override void OnDraw(Graphics g)
protected void DrawEllipse(Graphics g)
{
if (Shadow && IsBorderVisible)
if (Shadow)
{
DrawEllipse(g, ShadowColor, BorderSize, Color.Transparent, Rectangle.LocationOffset(ShadowOffset));
if (IsBorderVisible)
{
DrawEllipse(g, ShadowColor, BorderSize, Color.Transparent, Rectangle.LocationOffset(ShadowOffset));
}
else if (FillColor.A == 255)
{
DrawEllipse(g, Color.Transparent, 0, ShadowColor, Rectangle.LocationOffset(ShadowOffset));
}
}
DrawEllipse(g, BorderColor, BorderSize, FillColor, Rectangle);

View file

@ -54,9 +54,16 @@ public override void OnDraw(Graphics g)
protected void DrawRectangle(Graphics g)
{
if (Shadow && IsBorderVisible)
if (Shadow)
{
DrawRectangle(g, ShadowColor, BorderSize, Color.Transparent, Rectangle.LocationOffset(ShadowOffset), CornerRadius);
if (IsBorderVisible)
{
DrawRectangle(g, ShadowColor, BorderSize, Color.Transparent, Rectangle.LocationOffset(ShadowOffset), CornerRadius);
}
else if (FillColor.A == 255)
{
DrawRectangle(g, Color.Transparent, 0, ShadowColor, Rectangle.LocationOffset(ShadowOffset), CornerRadius);
}
}
DrawRectangle(g, BorderColor, BorderSize, FillColor, Rectangle, CornerRadius);

View file

@ -100,9 +100,16 @@ public override void OnDraw(Graphics g)
protected void DrawSpeechBalloon(Graphics g)
{
if (Shadow && IsBorderVisible)
if (Shadow)
{
DrawSpeechBalloon(g, ShadowColor, BorderSize, Color.Transparent, Rectangle.LocationOffset(ShadowOffset), TailPosition.Add(ShadowOffset));
if (IsBorderVisible)
{
DrawSpeechBalloon(g, ShadowColor, BorderSize, Color.Transparent, Rectangle.LocationOffset(ShadowOffset), TailPosition.Add(ShadowOffset));
}
else if (FillColor.A == 255)
{
DrawSpeechBalloon(g, Color.Transparent, 0, ShadowColor, Rectangle.LocationOffset(ShadowOffset), TailPosition.Add(ShadowOffset));
}
}
DrawSpeechBalloon(g, BorderColor, BorderSize, FillColor, Rectangle, TailPosition);