Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2fbf11a7
Commit
2fbf11a7
authored
May 05, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose blurSigma (#3743)
Fixes #3741
parent
6a46bf2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+7
-3
No files found.
packages/flutter/lib/src/painting/box_painter.dart
View file @
2fbf11a7
...
...
@@ -395,9 +395,13 @@ class BoxShadow {
final
double
spreadRadius
;
/// The [blurRadius] in sigmas instead of logical pixels.
///
/// See the sigma argument to [MaskFilter.blur].
///
// See SkBlurMask::ConvertRadiusToSigma().
//
https://github.com/google/skia/blob/bb5b77db51d2e149ee66db284903572a5aac09be/src/effects/SkBlurMask.cpp#L23
double
get
_
blurSigma
=>
blurRadius
*
0.57735
+
0.5
;
//
<https://github.com/google/skia/blob/bb5b77db51d2e149ee66db284903572a5aac09be/src/effects/SkBlurMask.cpp#L23>
double
get
blurSigma
=>
blurRadius
*
0.57735
+
0.5
;
/// Returns a new box shadow with its offset, blurRadius, and spreadRadius scaled by the given factor.
BoxShadow
scale
(
double
factor
)
{
...
...
@@ -1291,7 +1295,7 @@ class _BoxDecorationPainter extends BoxPainter {
for
(
BoxShadow
boxShadow
in
_decoration
.
boxShadow
)
{
final
Paint
paint
=
new
Paint
()
..
color
=
boxShadow
.
color
..
maskFilter
=
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
boxShadow
.
_
blurSigma
);
..
maskFilter
=
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
boxShadow
.
blurSigma
);
final
Rect
bounds
=
rect
.
shift
(
boxShadow
.
offset
).
inflate
(
boxShadow
.
spreadRadius
);
_paintBox
(
canvas
,
bounds
,
paint
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment