Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YaruBanner: adapt inner to outer border radius (#187)
* YaruBanner: adapt inner to outer border radius Fixes #186 * Add comment
- Loading branch information
1 parent
49d2a34
commit b1b9e2e
Showing
3 changed files
with
30 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
extension InnerBorderRadius on BorderRadius { | ||
/// Computer an inner border radius from a given padding | ||
BorderRadius inner(EdgeInsets padding) { | ||
return BorderRadius.only( | ||
topLeft: Radius.elliptical( | ||
topLeft.x - padding.left / 2, | ||
topLeft.y - padding.top / 2, | ||
), | ||
topRight: Radius.elliptical( | ||
topRight.x - padding.right / 2, | ||
topRight.y - padding.top / 2, | ||
), | ||
bottomRight: Radius.elliptical( | ||
bottomRight.x - padding.right / 2, | ||
bottomRight.y - padding.bottom / 2, | ||
), | ||
bottomLeft: Radius.elliptical( | ||
bottomLeft.x - padding.left / 2, | ||
bottomLeft.y - padding.bottom / 2, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters