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
52134511
Commit
52134511
authored
Aug 17, 2015
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #640 from Hixie/lerp-whitespace
Improve style in lerp.dart and box_painter.dart
parents
4cae568f
789064a4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
24 deletions
+30
-24
lerp.dart
packages/flutter/lib/base/lerp.dart
+7
-5
box_painter.dart
packages/flutter/lib/painting/box_painter.dart
+23
-19
No files found.
packages/flutter/lib/base/lerp.dart
View file @
52134511
...
@@ -29,7 +29,8 @@ Color lerpColor(Color a, Color b, double t) {
...
@@ -29,7 +29,8 @@ Color lerpColor(Color a, Color b, double t) {
lerpNum
(
a
.
alpha
,
b
.
alpha
,
t
).
toInt
(),
lerpNum
(
a
.
alpha
,
b
.
alpha
,
t
).
toInt
(),
lerpNum
(
a
.
red
,
b
.
red
,
t
).
toInt
(),
lerpNum
(
a
.
red
,
b
.
red
,
t
).
toInt
(),
lerpNum
(
a
.
green
,
b
.
green
,
t
).
toInt
(),
lerpNum
(
a
.
green
,
b
.
green
,
t
).
toInt
(),
lerpNum
(
a
.
blue
,
b
.
blue
,
t
).
toInt
());
lerpNum
(
a
.
blue
,
b
.
blue
,
t
).
toInt
()
);
}
}
Offset
lerpOffset
(
Offset
a
,
Offset
b
,
double
t
)
{
Offset
lerpOffset
(
Offset
a
,
Offset
b
,
double
t
)
{
...
@@ -55,5 +56,6 @@ Rect lerpRect(Rect a, Rect b, double t) {
...
@@ -55,5 +56,6 @@ Rect lerpRect(Rect a, Rect b, double t) {
lerpNum
(
a
.
left
,
b
.
left
,
t
),
lerpNum
(
a
.
left
,
b
.
left
,
t
),
lerpNum
(
a
.
top
,
b
.
top
,
t
),
lerpNum
(
a
.
top
,
b
.
top
,
t
),
lerpNum
(
a
.
right
,
b
.
right
,
t
),
lerpNum
(
a
.
right
,
b
.
right
,
t
),
lerpNum
(
a
.
bottom
,
b
.
bottom
,
t
));
lerpNum
(
a
.
bottom
,
b
.
bottom
,
t
)
);
}
}
packages/flutter/lib/painting/box_painter.dart
View file @
52134511
...
@@ -93,7 +93,8 @@ BoxShadow lerpBoxShadow(BoxShadow a, BoxShadow b, double t) {
...
@@ -93,7 +93,8 @@ BoxShadow lerpBoxShadow(BoxShadow a, BoxShadow b, double t) {
return
new
BoxShadow
(
return
new
BoxShadow
(
color:
lerpColor
(
a
.
color
,
b
.
color
,
t
),
color:
lerpColor
(
a
.
color
,
b
.
color
,
t
),
offset:
lerpOffset
(
a
.
offset
,
b
.
offset
,
t
),
offset:
lerpOffset
(
a
.
offset
,
b
.
offset
,
t
),
blur:
lerpNum
(
a
.
blur
,
b
.
blur
,
t
));
blur:
lerpNum
(
a
.
blur
,
b
.
blur
,
t
)
);
}
}
List
<
BoxShadow
>
lerpListBoxShadow
(
List
<
BoxShadow
>
a
,
List
<
BoxShadow
>
b
,
double
t
)
{
List
<
BoxShadow
>
lerpListBoxShadow
(
List
<
BoxShadow
>
a
,
List
<
BoxShadow
>
b
,
double
t
)
{
...
@@ -126,18 +127,19 @@ class LinearGradient extends Gradient {
...
@@ -126,18 +127,19 @@ class LinearGradient extends Gradient {
this
.
tileMode
:
sky
.
TileMode
.
clamp
this
.
tileMode
:
sky
.
TileMode
.
clamp
});
});
String
toString
()
=>
'LinearGradient(
$endPoints
,
$colors
,
$colorStops
,
$tileMode
)'
;
sky
.
Shader
createShader
()
{
return
new
sky
.
Gradient
.
linear
(
this
.
endPoints
,
this
.
colors
,
this
.
colorStops
,
this
.
tileMode
);
}
final
List
<
Point
>
endPoints
;
final
List
<
Point
>
endPoints
;
final
List
<
Color
>
colors
;
final
List
<
Color
>
colors
;
final
List
<
double
>
colorStops
;
final
List
<
double
>
colorStops
;
final
sky
.
TileMode
tileMode
;
final
sky
.
TileMode
tileMode
;
sky
.
Shader
createShader
()
{
return
new
sky
.
Gradient
.
linear
(
this
.
endPoints
,
this
.
colors
,
this
.
colorStops
,
this
.
tileMode
);
}
String
toString
()
{
return
'LinearGradient(
$endPoints
,
$colors
,
$colorStops
,
$tileMode
)'
;
}
}
}
class
RadialGradient
extends
Gradient
{
class
RadialGradient
extends
Gradient
{
...
@@ -149,19 +151,20 @@ class RadialGradient extends Gradient {
...
@@ -149,19 +151,20 @@ class RadialGradient extends Gradient {
this
.
tileMode
:
sky
.
TileMode
.
clamp
this
.
tileMode
:
sky
.
TileMode
.
clamp
});
});
String
toString
()
=>
final
Point
center
;
'RadialGradient(
$center
,
$radius
,
$colors
,
$colorStops
,
$tileMode
)'
;
final
double
radius
;
final
List
<
Color
>
colors
;
final
List
<
double
>
colorStops
;
final
sky
.
TileMode
tileMode
;
sky
.
Shader
createShader
()
{
sky
.
Shader
createShader
()
{
return
new
sky
.
Gradient
.
radial
(
this
.
center
,
this
.
radius
,
this
.
colors
,
return
new
sky
.
Gradient
.
radial
(
this
.
center
,
this
.
radius
,
this
.
colors
,
this
.
colorStops
,
this
.
tileMode
);
this
.
colorStops
,
this
.
tileMode
);
}
}
final
Point
center
;
String
toString
()
{
final
double
radius
;
return
'RadialGradient(
$center
,
$radius
,
$colors
,
$colorStops
,
$tileMode
)'
;
final
List
<
Color
>
colors
;
}
final
List
<
double
>
colorStops
;
final
sky
.
TileMode
tileMode
;
}
}
enum
BackgroundFit
{
fill
,
contain
,
cover
,
none
,
scaleDown
}
enum
BackgroundFit
{
fill
,
contain
,
cover
,
none
,
scaleDown
}
...
@@ -358,7 +361,8 @@ class BoxPainter {
...
@@ -358,7 +361,8 @@ class BoxPainter {
}
}
void
_paintBackgroundColor
(
sky
.
Canvas
canvas
,
Rect
rect
)
{
void
_paintBackgroundColor
(
sky
.
Canvas
canvas
,
Rect
rect
)
{
if
(
_decoration
.
backgroundColor
!=
null
||
_decoration
.
boxShadow
!=
null
||
if
(
_decoration
.
backgroundColor
!=
null
||
_decoration
.
boxShadow
!=
null
||
_decoration
.
gradient
!=
null
)
{
_decoration
.
gradient
!=
null
)
{
switch
(
_decoration
.
shape
)
{
switch
(
_decoration
.
shape
)
{
case
Shape
.
circle
:
case
Shape
.
circle
:
...
...
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