问题是使用 node.cache() 时,节点首先被缓存然后缩放。如何实现先缩放然后缓存?提前谢谢。
var stage = new Konva.Stage({
container: document.getElementById('stage'),
width: 400,
height: 400
});
var layer = new Konva.Layer();
var group1 = new Konva.Group();
var group2 = new Konva.Group();
var text1 = new Konva.Text({
text:'Test',
scale: {x:10,y:10},
x:10,
y:10
});
var text2 = new Konva.Text({
text:'Test',
scale: {x:10,y:10},
x:50,
y:50
});
text1.cache();
layer.add(text1);
layer.add(text2)
stage.add(layer);