KineticJS
KineticJS copied to clipboard
caching scaled image on kinetic 5.1.0
Hi, I just tried to cache an image like this :
myImage = new Kinetic.Image({
image: rasterObj,
x: parseFloat(detail.x) * iaScene.coeff,
y: parseFloat(detail.y) * iaScene.coeff,
width: detail.width,
height: detail.height,
scale: {x: iaScene.coeff, y: iaScene.coeff}
});
myImage.cache();
Unfortunately, scale ratio is not properly managed by cache system. In the source code of cache function, pixelRatio is hardcoded to 1. If I set it to the iaScene.coeff, the image looks good (width and height are wrong and must be devided by iaScene.coeff...).
Is there any workaround ? You confirm it is a bug ?
Regards,
Pascal
Can you provide demo? This example works fine: http://jsbin.com/garas/1/edit
Here it is : http://jsfiddle.net/3YV4t/
You are right. My demo using v5.0.1. Same bug with v5.1.0
+1 I have the same problem