Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. var paint = Paint();
  2. var path1 = Path();
  3.  
  4. path1.moveTo(size.width / 3, size.height * 3 / 4);
  5. path1.lineTo(size.width / 2, size.height * 5 / 6);
  6. path1.lineTo(size.width * 3 / 4, size.height * 4 / 6);
  7. paint.style = PaintingStyle.fill;
  8. path1.close();
  9.  
  10. // var trans = Float64List(16);
  11. // var ma = Matrix4.fromFloat64List(trans);
  12. // ma.setIdentity();
  13.  
  14. // canvas.drawRect(Rect.fromCircle(
  15. // center: new Offset(size.width / 3, size.height * 3 / 4),
  16. // radius: 100,
  17. // ), paint);
  18.  
  19. // canvas.clipRect(Rect.fromCircle(
  20. // center: new Offset(size.width / 3, size.height * 3 / 4),
  21. // radius: 100,
  22. // ));
  23.  
  24. var path2 = Path();
  25.  
  26. path2.addRect(Rect.fromCircle(
  27. center: new Offset(size.width / 3, size.height * 3 / 4),
  28. radius: 100,
  29. ));
  30. paint.style = PaintingStyle.fill;
  31. path2.close();
  32.  
  33. // paint.shader = RadialGradient(
  34. // colors: [
  35. // Colors.red,
  36. // Colors.blue,
  37. // ],
  38. // ).createShader(Rect.fromCircle(
  39. // center: new Offset(size.width / 3, size.height * 3 / 4),
  40. // radius: 180.0,
  41. // ));
  42.  
  43. var path3 = Path.combine(PathOperation.difference, path1, path2);
  44.  
  45. canvas.drawPath(path3, paint);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement