Requires

Provides

Stroke.js

Fills shape with color and strokes with a stroke

License:
Public domain (http://unlicense.org).
Authors:
Yaroslaff Fedin
  1. 23
  2. 24
  3. 25
  4. 26
  5. 27
  6. 28
  7. 29
  8. 30
  9. 31
  10. 32
  11. 33
  12. 34
  13. 35
  14. 36
  15. 37
  16. 38
  17. 39
  18. 40
  19. 41
  20. 42
  21. 43
  22. 44
  23. 45
  24. 46
  25. 47
  26. 48
  27. 49
  28. 50
  29. 51
  30. 52
  31. 53
  32. 54
  33. 55
  34. 56
  35. 57
  36. 58
  37. 59
  38. 60
  39. 61
  40. 62
LSD.Layer.Stroke = { properties: { stroke: ['width', ['cap', 'join', 'dash'], 'color'], color: ['gradient', 'color'], width: ['length'], cap: ['butt', 'round', 'square'], join: ['butt', 'round', 'square'], dash: ['tokens'] }, paint: function(color, width, cap, join, dash) { if (!width) width = 0; var gradient = color && (color['gradient'] || color['linear-gradient']); var result = { dash: dash, size: { width: width, height: width }, move: { x: width / 2, y: width / 2 }, inside: { left: width, top: width, right: width, bottom: width }, stroke: [!gradient && color || null, width, cap, join] }; if (this.radius != null) { var radius = result.radius = [] for (var i = 0; i < 4; i++) radius[i] = (this.radius[i] > 0) ? width / 1.5 : 0; } if (gradient) result.strokeLinear = [gradient] return result; } }