Browse Source
Merge pull request #4034 from AvaloniaUI/restore-previous-border-radius-deflate-behavior
Restore pre-BoxShadow rect deflation behavior
pull/4035/head
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
5 deletions
-
src/Avalonia.Controls/Utils/BorderRenderHelper.cs
|
|
|
@ -118,12 +118,11 @@ namespace Avalonia.Controls.Utils |
|
|
|
pen = new Pen(borderBrush, borderThickness); |
|
|
|
} |
|
|
|
|
|
|
|
var rrect = new RoundedRect(new Rect(_size), _cornerRadius.TopLeft, _cornerRadius.TopRight, |
|
|
|
_cornerRadius.BottomRight, _cornerRadius.BottomLeft); |
|
|
|
var rect = new Rect(_size); |
|
|
|
if (Math.Abs(borderThickness) > double.Epsilon) |
|
|
|
{ |
|
|
|
rrect = rrect.Deflate(borderThickness * 0.5, borderThickness * 0.5); |
|
|
|
} |
|
|
|
rect.Deflate(borderThickness * 0.5); |
|
|
|
var rrect = new RoundedRect(rect, _cornerRadius.TopLeft, _cornerRadius.TopRight, |
|
|
|
_cornerRadius.BottomRight, _cornerRadius.BottomLeft); |
|
|
|
|
|
|
|
context.PlatformImpl.DrawRectangle(background, pen, rrect, boxShadows); |
|
|
|
} |
|
|
|
|