Merge pull request #1673 from abarth/rm_old_paint_setters

Remove old setFoo functions on Paint
This commit is contained in:
Adam Barth 2015-10-19 12:28:09 -07:00
commit 47c854b8fc
13 changed files with 27 additions and 25 deletions

View file

@ -16,7 +16,7 @@ abstract class GameObject extends Node {
Paint _paintDebug = new Paint()
..color=new Color(0xffff0000)
..strokeWidth = 1.0
..setStyle(ui.PaintingStyle.stroke);
..style = ui.PaintingStyle.stroke;
bool collidingWith(GameObject obj) {
return (GameMath.distanceBetweenPoints(position, obj.position)

View file

@ -10,7 +10,7 @@ class PowerBar extends NodeWithSize {
Paint _paintOutline = new Paint()
..color = new Color(0xffffffff)
..strokeWidth = 1.0
..setStyle(ui.PaintingStyle.stroke);
..style = ui.PaintingStyle.stroke;
void paint(PaintingCanvas canvas) {
applyTransformForPivot(canvas);

View file

@ -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);

View file

@ -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()..setShader(yellowBlue));
new ui.Paint()..shader = yellowBlue);
// Scale x and y by 0.5.
var scaleMatrix = new Float64List.fromList([

View file

@ -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);
}
)

View file

@ -49,11 +49,11 @@ class StockArrow extends StatelessComponent {
path.lineTo(centerX + w, arrowY + h);
path.lineTo(centerX - w, arrowY + h);
path.close();
paint.setStyle(ui.PaintingStyle.fill);
paint.style = ui.PaintingStyle.fill;
canvas.drawPath(path, paint);
// Draw a circle that circumscribes the arrow.
paint.setStyle(ui.PaintingStyle.stroke);
paint.style = ui.PaintingStyle.stroke;
canvas.drawCircle(new Point(centerX, centerY), r, paint);
});

View file

@ -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);

View file

@ -866,7 +866,7 @@ class BoxPainter {
Paint paint = new Paint()
..color = _decoration.border.top.color
..strokeWidth = width
..setStyle(ui.PaintingStyle.stroke);
..style = ui.PaintingStyle.stroke;
Point center = rect.center;
double radius = (rect.shortestSide - width) / 2.0;
canvas.drawCircle(center, radius, paint);

View file

@ -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;
}

View file

@ -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

View file

@ -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)
..setStyle(ui.PaintingStyle.stroke)
..style = ui.PaintingStyle.stroke
..strokeWidth = 1.0;
canvas.drawCircle(_toPoint(center), _scale(radius), paint);

View file

@ -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;
}
}

View file

@ -14,7 +14,7 @@ class VirtualJoystick extends NodeWithSize {
_paintControl = new Paint()
..color=new Color(0xffffffff)
..strokeWidth = 1.0
..setStyle(ui.PaintingStyle.stroke);
..style = ui.PaintingStyle.stroke;
}
Point _value = Point.origin;