使用jcanvas,我如何链接两个可拖动的层,使它们一起移动。
例如:圆形和文档图标是两个不同的图层。我如何拥有它们?
a)在同一层上绘制或
b)一起搬家
// document
.drawArc({
layer: true,
groups: ['document'],
fillStyle: 'yellow',
x: 100, y: 250,
radius: 50
})
.drawImage({
groups: ['document'],
source: "img/document.jpg",
x: 100, y: 250,
width:40, height: 40,
layer: true
})
$('canvas').setLayerGroup('document', {
draggable: true,
bringToFront: true
})
发布于 2015-06-12 09:37:48
您可以使用dragGroups:[]
完成此操作
代码在这里
$('canvas').drawArc({
layer: true,
groups: ['document'],
dragGroups: ['document'],
draggable: true,
fillStyle: 'yellow',
x: 100, y: 250,
radius: 50
})
.drawImage({
groups: ['document'],
dragGroups: ['document'],
draggable: true,
source: "img/document.jpg",
x: 100, y: 250,
width: 40, height: 40,
layer: true
}).drawLayers();
https://stackoverflow.com/questions/30427075
复制相似问题