0
var path = new Path.Rectangle(new Point(50, 50), new Size(100, 50));
path.style = {
fillColor: 'white',
strokeColor: 'black'
};
var copy = {};
//Create a copy of the path and set its stroke color to red:
for (var i = 0; i < 100; i++) {
var copy[i] = path.clone();
console.log(copy[i]);
copy[i].strokeColor = 'red';
//Rotate the copy by 45 degrees:
copy[i].rotate(45);
}
'copy'是一个对象而不是数组 – Satpal
我该如何在这里使用复制作为数组? –