如何使用paperjs绘制多个圈子?我尝试删除path.removeOnDrag()
它的工作原理和删除fillcolor
后,但输出不符合预期。使用paperJS绘制多个圈子
<script type="text/paperscript" canvas="canvas">
function onMouseDrag(event) {
// The radius is the distance between the position
// where the user clicked and the current position
// of the mouse.
var path = new Path.Circle({
center: event.downPoint,
radius: (event.downPoint - event.point).length,
fillColor: null,
strokeColor: 'black',
strokeWidth: 10
});
// Remove this path on the next drag event:
path.removeOnDrag();
};
</script>
它可以帮助您描述您的期望。代码完全符合它应该做的事情,那么你认为的问题是什么?此外,jsfiddle.net示例可能会有所帮助;在这种情况下,http://jsfiddle.net/vupt3 –
由于[http://jsfiddle.net/vupt3/](http://jsfiddle.net/vupt3/)显示正在输出。如何绘制另一个圈子而不隐藏第一个圈子。 – chiyango