【发布时间】:2013-05-31 19:40:15
【问题描述】:
如何使用 paperjs 绘制多个圆圈?我尝试删除path.removeOnDrag(),它可以工作,删除fillcolor后,输出不符合预期。
<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 示例可能会有所帮助;在这种情况下,jsfiddle.net/vupt3
-
http://jsfiddle.net/vupt3/ 显示正在获得输出。如何在不隐藏第一个圆圈的情况下绘制另一个圆圈。
标签: javascript paperjs