退房:http: //jsfiddle.net/aqaP7/4/,
和
http://shedlimited.debrucellc.com/test3/canvaskinclip.html ,
我想让 html5 图像可调整大小,它需要基于 html5 等,因为我的剪辑区域在 html5 中
我认为这与 mousedown 事件有关,但例如我如何判断鼠标是否在形状的角落?我可以将代码添加到我的圈子 - mousedown 函数吗?
circle.on("mousedown", function(){
draggingShape = this;
var mousePos = stage.getMousePosition();
draggingRectOffsetX = mousePos.x - circle._x;
draggingRectOffsetY = mousePos.y - circle._y;
});
circle.on("mouseover", function(){
document.body.style.cursor = "pointer";
});
circle.on("mouseout", function(){
document.body.style.cursor = "default";
});
layer.add(circle);
stage.on("mouseout", function(){
draggingShape = undefined;
}, false);
stage.on("mousemove", function(){
var mousePos = stage.getMousePosition();
if (draggingShape) {
draggingShape._x = mousePos.x - draggingRectOffsetX;
draggingShape._y = mousePos.y - draggingRectOffsetY;
layer.draw();
}