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
2aa79d56
Commit
2aa79d56
authored
Oct 19, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old setFoo functions on Paint
We now just use Dart properties, which is more idiomatic.
parent
88bcfa2d
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
27 additions
and
25 deletions
+27
-25
game_objects.dart
examples/game/lib/game_objects.dart
+1
-1
power_bar.dart
examples/game/lib/power_bar.dart
+1
-1
baseline.dart
examples/raw/baseline.dart
+7
-6
painting.dart
examples/raw/painting.dart
+1
-1
baseline.dart
examples/rendering/baseline.dart
+4
-4
stock_arrow.dart
examples/stocks/lib/stock_arrow.dart
+2
-2
overlay_geometry.dart
examples/widgets/overlay_geometry.dart
+4
-3
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+1
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-1
particle_system.dart
packages/flutter_sprites/lib/src/particle_system.dart
+1
-1
physics_debug.dart
packages/flutter_sprites/lib/src/physics_debug.dart
+1
-1
textured_line.dart
packages/flutter_sprites/lib/src/textured_line.dart
+2
-2
virtual_joystick.dart
packages/flutter_sprites/lib/src/virtual_joystick.dart
+1
-1
No files found.
examples/game/lib/game_objects.dart
View file @
2aa79d56
...
@@ -16,7 +16,7 @@ abstract class GameObject extends Node {
...
@@ -16,7 +16,7 @@ abstract class GameObject extends Node {
Paint
_paintDebug
=
new
Paint
()
Paint
_paintDebug
=
new
Paint
()
..
color
=
new
Color
(
0xffff0000
)
..
color
=
new
Color
(
0xffff0000
)
..
strokeWidth
=
1.0
..
strokeWidth
=
1.0
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
bool
collidingWith
(
GameObject
obj
)
{
bool
collidingWith
(
GameObject
obj
)
{
return
(
GameMath
.
distanceBetweenPoints
(
position
,
obj
.
position
)
return
(
GameMath
.
distanceBetweenPoints
(
position
,
obj
.
position
)
...
...
examples/game/lib/power_bar.dart
View file @
2aa79d56
...
@@ -10,7 +10,7 @@ class PowerBar extends NodeWithSize {
...
@@ -10,7 +10,7 @@ class PowerBar extends NodeWithSize {
Paint
_paintOutline
=
new
Paint
()
Paint
_paintOutline
=
new
Paint
()
..
color
=
new
Color
(
0xffffffff
)
..
color
=
new
Color
(
0xffffffff
)
..
strokeWidth
=
1.0
..
strokeWidth
=
1.0
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
void
paint
(
PaintingCanvas
canvas
)
{
void
paint
(
PaintingCanvas
canvas
)
{
applyTransformForPivot
(
canvas
);
applyTransformForPivot
(
canvas
);
...
...
examples/raw/baseline.dart
View file @
2aa79d56
...
@@ -36,9 +36,10 @@ void drawText(ui.Canvas canvas, String lh) {
...
@@ -36,9 +36,10 @@ void drawText(ui.Canvas canvas, String lh) {
path
.
lineTo
(
block
.
maxContentWidth
,
block
.
alphabeticBaseline
);
path
.
lineTo
(
block
.
maxContentWidth
,
block
.
alphabeticBaseline
);
path
.
moveTo
(
0.0
,
block
.
height
);
path
.
moveTo
(
0.0
,
block
.
height
);
path
.
lineTo
(
block
.
maxContentWidth
,
block
.
height
);
path
.
lineTo
(
block
.
maxContentWidth
,
block
.
height
);
paint
.
color
=
const
ui
.
Color
(
0xFFFF9000
);
paint
paint
.
setStyle
(
ui
.
PaintingStyle
.
stroke
);
..
color
=
const
ui
.
Color
(
0xFFFF9000
)
paint
.
strokeWidth
=
3.0
;
..
style
=
ui
.
PaintingStyle
.
stroke
..
strokeWidth
=
3.0
;
canvas
.
drawPath
(
path
,
paint
);
canvas
.
drawPath
(
path
,
paint
);
// paint the text
// paint the text
...
@@ -49,9 +50,9 @@ ui.Picture paint(ui.Rect paintBounds) {
...
@@ -49,9 +50,9 @@ ui.Picture paint(ui.Rect paintBounds) {
ui
.
PictureRecorder
recorder
=
new
ui
.
PictureRecorder
();
ui
.
PictureRecorder
recorder
=
new
ui
.
PictureRecorder
();
ui
.
Canvas
canvas
=
new
ui
.
Canvas
(
recorder
,
paintBounds
);
ui
.
Canvas
canvas
=
new
ui
.
Canvas
(
recorder
,
paintBounds
);
ui
.
Paint
paint
=
new
ui
.
Paint
()
;
ui
.
Paint
paint
=
new
ui
.
Paint
()
paint
.
color
=
const
ui
.
Color
(
0xFFFFFFFF
);
..
color
=
const
ui
.
Color
(
0xFFFFFFFF
)
paint
.
setStyle
(
ui
.
PaintingStyle
.
fill
)
;
..
style
=
ui
.
PaintingStyle
.
fill
;
canvas
.
drawRect
(
new
ui
.
Rect
.
fromLTRB
(
0.0
,
0.0
,
ui
.
view
.
width
,
ui
.
view
.
height
),
paint
);
canvas
.
drawRect
(
new
ui
.
Rect
.
fromLTRB
(
0.0
,
0.0
,
ui
.
view
.
width
,
ui
.
view
.
height
),
paint
);
canvas
.
translate
(
10.0
,
0.0
);
canvas
.
translate
(
10.0
,
0.0
);
...
...
examples/raw/painting.dart
View file @
2aa79d56
...
@@ -29,7 +29,7 @@ ui.Picture paint(ui.Rect paintBounds) {
...
@@ -29,7 +29,7 @@ ui.Picture paint(ui.Rect paintBounds) {
[
new
ui
.
Point
(-
radius
,
-
radius
),
new
ui
.
Point
(
0.0
,
0.0
)],
[
new
ui
.
Point
(-
radius
,
-
radius
),
new
ui
.
Point
(
0.0
,
0.0
)],
[
const
ui
.
Color
(
0xFFFFFF00
),
const
ui
.
Color
(
0xFF0000FF
)]);
[
const
ui
.
Color
(
0xFFFFFF00
),
const
ui
.
Color
(
0xFF0000FF
)]);
canvas
.
drawRect
(
new
ui
.
Rect
.
fromLTRB
(-
radius
,
-
radius
,
radius
,
radius
),
canvas
.
drawRect
(
new
ui
.
Rect
.
fromLTRB
(-
radius
,
-
radius
,
radius
,
radius
),
new
ui
.
Paint
()..
s
etShader
(
yellowBlue
)
);
new
ui
.
Paint
()..
s
hader
=
yellowBlue
);
// Scale x and y by 0.5.
// Scale x and y by 0.5.
var
scaleMatrix
=
new
Float64List
.
fromList
([
var
scaleMatrix
=
new
Float64List
.
fromList
([
...
...
examples/rendering/baseline.dart
View file @
2aa79d56
...
@@ -48,10 +48,10 @@ RenderBox getBox(double lh) {
...
@@ -48,10 +48,10 @@ RenderBox getBox(double lh) {
path
.
lineTo
(
w
,
baseline
);
path
.
lineTo
(
w
,
baseline
);
path
.
moveTo
(
0.0
,
h
);
path
.
moveTo
(
0.0
,
h
);
path
.
lineTo
(
w
,
h
);
path
.
lineTo
(
w
,
h
);
Paint
paint
=
new
Paint
()
;
Paint
paint
=
new
Paint
()
paint
.
color
=
const
Color
(
0xFFFF9000
);
..
color
=
const
Color
(
0xFFFF9000
)
paint
.
setStyle
(
ui
.
PaintingStyle
.
stroke
);
..
style
=
ui
.
PaintingStyle
.
stroke
paint
.
strokeWidth
=
3.0
;
.
.
strokeWidth
=
3.0
;
canvas
.
drawPath
(
path
,
paint
);
canvas
.
drawPath
(
path
,
paint
);
}
}
)
)
...
...
examples/stocks/lib/stock_arrow.dart
View file @
2aa79d56
...
@@ -49,11 +49,11 @@ class StockArrow extends StatelessComponent {
...
@@ -49,11 +49,11 @@ class StockArrow extends StatelessComponent {
path
.
lineTo
(
centerX
+
w
,
arrowY
+
h
);
path
.
lineTo
(
centerX
+
w
,
arrowY
+
h
);
path
.
lineTo
(
centerX
-
w
,
arrowY
+
h
);
path
.
lineTo
(
centerX
-
w
,
arrowY
+
h
);
path
.
close
();
path
.
close
();
paint
.
s
etStyle
(
ui
.
PaintingStyle
.
fill
)
;
paint
.
s
tyle
=
ui
.
PaintingStyle
.
fill
;
canvas
.
drawPath
(
path
,
paint
);
canvas
.
drawPath
(
path
,
paint
);
// Draw a circle that circumscribes the arrow.
// Draw a circle that circumscribes the arrow.
paint
.
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
paint
.
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
canvas
.
drawCircle
(
new
Point
(
centerX
,
centerY
),
r
,
paint
);
canvas
.
drawCircle
(
new
Point
(
centerX
,
centerY
),
r
,
paint
);
});
});
...
...
examples/widgets/overlay_geometry.dart
View file @
2aa79d56
...
@@ -36,9 +36,10 @@ class Marker extends StatelessComponent {
...
@@ -36,9 +36,10 @@ class Marker extends StatelessComponent {
double
r
=
size
/
2.0
;
double
r
=
size
/
2.0
;
canvas
.
drawCircle
(
new
Point
(
r
,
r
),
r
,
paint
);
canvas
.
drawCircle
(
new
Point
(
r
,
r
),
r
,
paint
);
paint
.
color
=
const
Color
(
0xFFFFFFFF
);
paint
paint
.
setStyle
(
ui
.
PaintingStyle
.
stroke
);
..
color
=
const
Color
(
0xFFFFFFFF
)
paint
.
strokeWidth
=
1.0
;
..
style
=
ui
.
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
;
if
(
type
==
MarkerType
.
topLeft
)
{
if
(
type
==
MarkerType
.
topLeft
)
{
canvas
.
drawLine
(
new
Point
(
r
,
r
),
new
Point
(
r
+
r
-
1.0
,
r
),
paint
);
canvas
.
drawLine
(
new
Point
(
r
,
r
),
new
Point
(
r
+
r
-
1.0
,
r
),
paint
);
canvas
.
drawLine
(
new
Point
(
r
,
r
),
new
Point
(
r
,
r
+
r
-
1.0
),
paint
);
canvas
.
drawLine
(
new
Point
(
r
,
r
),
new
Point
(
r
,
r
+
r
-
1.0
),
paint
);
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
2aa79d56
...
@@ -866,7 +866,7 @@ class BoxPainter {
...
@@ -866,7 +866,7 @@ class BoxPainter {
Paint
paint
=
new
Paint
()
Paint
paint
=
new
Paint
()
..
color
=
_decoration
.
border
.
top
.
color
..
color
=
_decoration
.
border
.
top
.
color
..
strokeWidth
=
width
..
strokeWidth
=
width
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
Point
center
=
rect
.
center
;
Point
center
=
rect
.
center
;
double
radius
=
(
rect
.
shortestSide
-
width
)
/
2.0
;
double
radius
=
(
rect
.
shortestSide
-
width
)
/
2.0
;
canvas
.
drawCircle
(
center
,
radius
,
paint
);
canvas
.
drawCircle
(
center
,
radius
,
paint
);
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
2aa79d56
...
@@ -246,7 +246,7 @@ class PaintingContext {
...
@@ -246,7 +246,7 @@ class PaintingContext {
static
Paint
_getPaintForAlpha
(
int
alpha
)
{
static
Paint
_getPaintForAlpha
(
int
alpha
)
{
return
new
Paint
()
return
new
Paint
()
..
color
=
new
Color
.
fromARGB
(
alpha
,
0
,
0
,
0
)
..
color
=
new
Color
.
fromARGB
(
alpha
,
0
,
0
,
0
)
..
setTransferMode
(
TransferMode
.
srcOver
)
..
transferMode
=
TransferMode
.
srcOver
..
isAntiAlias
=
false
;
..
isAntiAlias
=
false
;
}
}
...
...
packages/flutter_sprites/lib/src/particle_system.dart
View file @
2aa79d56
...
@@ -363,7 +363,7 @@ class ParticleSystem extends Node {
...
@@ -363,7 +363,7 @@ class ParticleSystem extends Node {
List
<
Rect
>
rects
=
[];
List
<
Rect
>
rects
=
[];
List
<
Color
>
colors
=
[];
List
<
Color
>
colors
=
[];
_paint
.
setTransferMode
(
transferMode
)
;
_paint
.
transferMode
=
transferMode
;
for
(
_Particle
particle
in
_particles
)
{
for
(
_Particle
particle
in
_particles
)
{
// Rect
// Rect
...
...
packages/flutter_sprites/lib/src/physics_debug.dart
View file @
2aa79d56
...
@@ -43,7 +43,7 @@ class _PhysicsDebugDraw extends box2d.DebugDraw {
...
@@ -43,7 +43,7 @@ class _PhysicsDebugDraw extends box2d.DebugDraw {
void
drawCircle
(
Vector2
center
,
num
radius
,
box2d
.
Color3i
color
,
[
Vector2
axis
])
{
void
drawCircle
(
Vector2
center
,
num
radius
,
box2d
.
Color3i
color
,
[
Vector2
axis
])
{
Paint
paint
=
new
Paint
()
Paint
paint
=
new
Paint
()
..
color
=
_toColor
(
color
)
..
color
=
_toColor
(
color
)
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
;
..
strokeWidth
=
1.0
;
canvas
.
drawCircle
(
_toPoint
(
center
),
_scale
(
radius
),
paint
);
canvas
.
drawCircle
(
_toPoint
(
center
),
_scale
(
radius
),
paint
);
...
...
packages/flutter_sprites/lib/src/textured_line.dart
View file @
2aa79d56
...
@@ -41,8 +41,8 @@ class TexturedLinePainter {
...
@@ -41,8 +41,8 @@ class TexturedLinePainter {
ui
.
ImageShader
shader
=
new
ui
.
ImageShader
(
texture
.
image
,
ui
.
ImageShader
shader
=
new
ui
.
ImageShader
(
texture
.
image
,
ui
.
TileMode
.
repeated
,
ui
.
TileMode
.
repeated
,
matrix
.
storage
);
ui
.
TileMode
.
repeated
,
ui
.
TileMode
.
repeated
,
matrix
.
storage
);
_cachedPaint
=
new
Paint
()
;
_cachedPaint
=
new
Paint
()
_cachedPaint
.
setShader
(
shader
)
;
..
shader
=
shader
;
}
}
}
}
...
...
packages/flutter_sprites/lib/src/virtual_joystick.dart
View file @
2aa79d56
...
@@ -14,7 +14,7 @@ class VirtualJoystick extends NodeWithSize {
...
@@ -14,7 +14,7 @@ class VirtualJoystick extends NodeWithSize {
_paintControl
=
new
Paint
()
_paintControl
=
new
Paint
()
..
color
=
new
Color
(
0xffffffff
)
..
color
=
new
Color
(
0xffffffff
)
..
strokeWidth
=
1.0
..
strokeWidth
=
1.0
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
}
}
Point
_value
=
Point
.
origin
;
Point
_value
=
Point
.
origin
;
...
...
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