As the jCanvas script hereunder ... The layer rotate as expected, but only 1 time/click. Other clicks are well logged to the console but no rotation of the layer.
Is so has an idea/advice ...
pm
$('canvas').drawImage(
{
source: 'image/domino/DOM-T2.png',
type: 'image',
name: 'DOM-T2-'+currentLayer,
groups: ['DOM-T2-'+currentLayer],
dragGroups: ['DOM-T2-'+currentLayer],
x: 520, y: 20,
draggable: true,
fromCenter: false,
layer: true,
click: function(layer)
{
console.log("Rotate"+'DOM-T2-'+currentLayer);
$('canvas').animateLayer('DOM-T2-'+currentLayer,
{
rotate: 90
});
}
});
</script>
I found, with help ...
the rotation value is not 'additive', meaning I assigned the value allready contained in rotate and not "rotate: rotate+90".
Hope it may help someone else :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.