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
Hide 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 {
Paint
_paintDebug
=
new
Paint
()
..
color
=
new
Color
(
0xffff0000
)
..
strokeWidth
=
1.0
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
bool
collidingWith
(
GameObject
obj
)
{
return
(
GameMath
.
distanceBetweenPoints
(
position
,
obj
.
position
)
...
...
examples/game/lib/power_bar.dart
View file @
2aa79d56
...
...
@@ -10,7 +10,7 @@ class PowerBar extends NodeWithSize {
Paint
_paintOutline
=
new
Paint
()
..
color
=
new
Color
(
0xffffffff
)
..
strokeWidth
=
1.0
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
void
paint
(
PaintingCanvas
canvas
)
{
applyTransformForPivot
(
canvas
);
...
...
examples/raw/baseline.dart
View file @
2aa79d56
...
...
@@ -36,9 +36,10 @@ void drawText(ui.Canvas canvas, String lh) {
path
.
lineTo
(
block
.
maxContentWidth
,
block
.
alphabeticBaseline
);
path
.
moveTo
(
0.0
,
block
.
height
);
path
.
lineTo
(
block
.
maxContentWidth
,
block
.
height
);
paint
.
color
=
const
ui
.
Color
(
0xFFFF9000
);
paint
.
setStyle
(
ui
.
PaintingStyle
.
stroke
);
paint
.
strokeWidth
=
3.0
;
paint
..
color
=
const
ui
.
Color
(
0xFFFF9000
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
strokeWidth
=
3.0
;
canvas
.
drawPath
(
path
,
paint
);
// paint the text
...
...
@@ -49,9 +50,9 @@ ui.Picture paint(ui.Rect paintBounds) {
ui
.
PictureRecorder
recorder
=
new
ui
.
PictureRecorder
();
ui
.
Canvas
canvas
=
new
ui
.
Canvas
(
recorder
,
paintBounds
);
ui
.
Paint
paint
=
new
ui
.
Paint
()
;
paint
.
color
=
const
ui
.
Color
(
0xFFFFFFFF
);
paint
.
setStyle
(
ui
.
PaintingStyle
.
fill
)
;
ui
.
Paint
paint
=
new
ui
.
Paint
()
..
color
=
const
ui
.
Color
(
0xFFFFFFFF
)
..
style
=
ui
.
PaintingStyle
.
fill
;
canvas
.
drawRect
(
new
ui
.
Rect
.
fromLTRB
(
0.0
,
0.0
,
ui
.
view
.
width
,
ui
.
view
.
height
),
paint
);
canvas
.
translate
(
10.0
,
0.0
);
...
...
examples/raw/painting.dart
View file @
2aa79d56
...
...
@@ -29,7 +29,7 @@ ui.Picture paint(ui.Rect paintBounds) {
[
new
ui
.
Point
(-
radius
,
-
radius
),
new
ui
.
Point
(
0.0
,
0.0
)],
[
const
ui
.
Color
(
0xFFFFFF00
),
const
ui
.
Color
(
0xFF0000FF
)]);
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.
var
scaleMatrix
=
new
Float64List
.
fromList
([
...
...
examples/rendering/baseline.dart
View file @
2aa79d56
...
...
@@ -48,10 +48,10 @@ RenderBox getBox(double lh) {
path
.
lineTo
(
w
,
baseline
);
path
.
moveTo
(
0.0
,
h
);
path
.
lineTo
(
w
,
h
);
Paint
paint
=
new
Paint
()
;
paint
.
color
=
const
Color
(
0xFFFF9000
);
paint
.
setStyle
(
ui
.
PaintingStyle
.
stroke
);
paint
.
strokeWidth
=
3.0
;
Paint
paint
=
new
Paint
()
..
color
=
const
Color
(
0xFFFF9000
)
..
style
=
ui
.
PaintingStyle
.
stroke
.
.
strokeWidth
=
3.0
;
canvas
.
drawPath
(
path
,
paint
);
}
)
...
...
examples/stocks/lib/stock_arrow.dart
View file @
2aa79d56
...
...
@@ -49,11 +49,11 @@ class StockArrow extends StatelessComponent {
path
.
lineTo
(
centerX
+
w
,
arrowY
+
h
);
path
.
lineTo
(
centerX
-
w
,
arrowY
+
h
);
path
.
close
();
paint
.
s
etStyle
(
ui
.
PaintingStyle
.
fill
)
;
paint
.
s
tyle
=
ui
.
PaintingStyle
.
fill
;
canvas
.
drawPath
(
path
,
paint
);
// 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
);
});
...
...
examples/widgets/overlay_geometry.dart
View file @
2aa79d56
...
...
@@ -36,9 +36,10 @@ class Marker extends StatelessComponent {
double
r
=
size
/
2.0
;
canvas
.
drawCircle
(
new
Point
(
r
,
r
),
r
,
paint
);
paint
.
color
=
const
Color
(
0xFFFFFFFF
);
paint
.
setStyle
(
ui
.
PaintingStyle
.
stroke
);
paint
.
strokeWidth
=
1.0
;
paint
..
color
=
const
Color
(
0xFFFFFFFF
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
;
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
+
r
-
1.0
),
paint
);
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
2aa79d56
...
...
@@ -866,7 +866,7 @@ class BoxPainter {
Paint
paint
=
new
Paint
()
..
color
=
_decoration
.
border
.
top
.
color
..
strokeWidth
=
width
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
Point
center
=
rect
.
center
;
double
radius
=
(
rect
.
shortestSide
-
width
)
/
2.0
;
canvas
.
drawCircle
(
center
,
radius
,
paint
);
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
2aa79d56
...
...
@@ -246,7 +246,7 @@ class PaintingContext {
static
Paint
_getPaintForAlpha
(
int
alpha
)
{
return
new
Paint
()
..
color
=
new
Color
.
fromARGB
(
alpha
,
0
,
0
,
0
)
..
setTransferMode
(
TransferMode
.
srcOver
)
..
transferMode
=
TransferMode
.
srcOver
..
isAntiAlias
=
false
;
}
...
...
packages/flutter_sprites/lib/src/particle_system.dart
View file @
2aa79d56
...
...
@@ -363,7 +363,7 @@ class ParticleSystem extends Node {
List
<
Rect
>
rects
=
[];
List
<
Color
>
colors
=
[];
_paint
.
setTransferMode
(
transferMode
)
;
_paint
.
transferMode
=
transferMode
;
for
(
_Particle
particle
in
_particles
)
{
// Rect
...
...
packages/flutter_sprites/lib/src/physics_debug.dart
View file @
2aa79d56
...
...
@@ -43,7 +43,7 @@ class _PhysicsDebugDraw extends box2d.DebugDraw {
void
drawCircle
(
Vector2
center
,
num
radius
,
box2d
.
Color3i
color
,
[
Vector2
axis
])
{
Paint
paint
=
new
Paint
()
..
color
=
_toColor
(
color
)
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
;
canvas
.
drawCircle
(
_toPoint
(
center
),
_scale
(
radius
),
paint
);
...
...
packages/flutter_sprites/lib/src/textured_line.dart
View file @
2aa79d56
...
...
@@ -41,8 +41,8 @@ class TexturedLinePainter {
ui
.
ImageShader
shader
=
new
ui
.
ImageShader
(
texture
.
image
,
ui
.
TileMode
.
repeated
,
ui
.
TileMode
.
repeated
,
matrix
.
storage
);
_cachedPaint
=
new
Paint
()
;
_cachedPaint
.
setShader
(
shader
)
;
_cachedPaint
=
new
Paint
()
..
shader
=
shader
;
}
}
...
...
packages/flutter_sprites/lib/src/virtual_joystick.dart
View file @
2aa79d56
...
...
@@ -14,7 +14,7 @@ class VirtualJoystick extends NodeWithSize {
_paintControl
=
new
Paint
()
..
color
=
new
Color
(
0xffffffff
)
..
strokeWidth
=
1.0
..
s
etStyle
(
ui
.
PaintingStyle
.
stroke
)
;
..
s
tyle
=
ui
.
PaintingStyle
.
stroke
;
}
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