使用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
})