当我在画布中添加图像并对图像执行transformMatrix时,会移动roundingBox。
看看我的jsfiddle:http://jsfiddle.net/ULsr4/2/
canvas = this .__ canvas = new fabric.Canvas(' canvas'); fabric.Image.fromURL(' http://icons.iconarchive.com/icons/archigraphs/lovely-bones/256/Tree-icon.png',function(img){
img.transformMatrix = [1, 0, 0.7, 1, 0, 0];
canvas.add(img);
img.setCoords();
});
canvas.renderAll();
有人可以帮助我吗?
答案 0 :(得分:0)
不知道你是否仍然需要它,但尝试在你的fabric.Image.fromURL回调中使用group对象,即:
var group = new fabric.Group([img], {
left: 10,
top: 10
});
canvas.add(group);
group.setCoords();