0
我用kineticjs画了两个圆, 我想对称地改变第一个圆的dragmove上的圆的位置,这是我的代码。在dragmove上对称地改变圆的位置kineticjs的另一个圆
newArc = new Kinetic.Circle({
x: mouse.x,
y: mouse.y,
radius: .25,
fill: Color,
stroke: "lightgray",
strokeWidth: 3,
draggable: true
});
layer.add(newArc);
newArcMir = new Kinetic.Circle({
x: stage.getWidth()-mouse.x,
y: mouse.y,
radius: .25,
fill: Color,
stroke: "lightgray",
strokeWidth: 3,
draggable: true
});
newArc.on('dragmove', function() {
newArcMir.setX(stage.getWidth()-this.getX());
newArcMir.setY(this.getY());
});
newArcMir.on('dragmove', function() {
newArc.setX(stage.getWidth()-this.getX());
newArc.setY(this.getY());
});
我得到一个错误“遗漏的类型错误:无法读取属性‘中与此相关的行
newArcMir.setX(stage.getWidth()-this.getX());
你可以做任何jsfidle演示? – lavrton
这是jsfidle演示http://jsfiddle.net/D2vbd/ –
你演示不工作,我的意思是它坏了。 – lavrton