这是我的代码
var _changeCanvasIcons = function(side){
side.hasControlCallback = {
tr: true,
mtr: true
};
side.controlCallback = {
tr: function (ctx, left, top, size) {
var image = new Image(), x, y;
image.src = 'assets/img/control-icons/delete.png';
x = left - image.width/2 + size/2;
y = top - image.height/2 + size/2;
ctx.drawImage(image, x, y);
},
mtr: function (ctx, left, top, size) {
var image = new Image(), x, y;
image.src = 'assets/img/control-icons/rotate.png';
ctx.drawImage(image, x, y);
}
};
}