equal
deleted
inserted
replaced
55 }, |
55 }, |
56 getImageShape: function(center, radius) { |
56 getImageShape: function(center, radius) { |
57 return new paper.Path.Star([0, 0], 8, radius*1, radius*0.7); |
57 return new paper.Path.Star([0, 0], 8, radius*1, radius*0.7); |
58 } |
58 } |
59 }, |
59 }, |
|
60 "svg": function(path){ |
|
61 return { |
|
62 getShape: function() { |
|
63 return new paper.Path(path); |
|
64 }, |
|
65 getImageShape: function(center, radius) { |
|
66 // No calcul for the moment |
|
67 return new paper.Path(); |
|
68 } |
|
69 } |
|
70 } |
60 }; |
71 }; |
61 |
72 |
62 var ShapeBuilder = function (shape){ |
73 var ShapeBuilder = function (shape){ |
|
74 if(typeof shape==="undefined"){ |
|
75 shape = "circle"; |
|
76 } |
|
77 if(shape.substr(0,4)=="svg:"){ |
|
78 return builders["svg"](shape.substr(4)); |
|
79 } |
63 if(!(shape in builders)){ |
80 if(!(shape in builders)){ |
64 shape = "circle"; |
81 shape = "circle"; |
65 } |
82 } |
66 return builders[shape]; |
83 return builders[shape]; |
67 }; |
84 }; |
68 |
85 |
69 return ShapeBuilder; |
86 return ShapeBuilder; |
70 |
87 |
71 }); |
88 }); |