1
退房:http://jsfiddle.net/aqaP7/4/,如何使HTML5畫布形狀可調整大小
和
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();
}