fixed pixel ratio issue with buffer canvas usage

This commit is contained in:
Eric Rowell
2013-11-02 22:31:09 -07:00
parent 4ed8ac8088
commit f5d5e26e5e
6 changed files with 71 additions and 2 deletions

View File

@@ -214,7 +214,7 @@
that._animationLoop();
}
};
RAF = (function() {
var RAF = (function() {
return window.requestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.mozRequestAnimationFrame

View File

@@ -229,6 +229,7 @@
stage, bufferCanvas, bufferContext;
if(drawFunc && this.isVisible()) {
// if buffer canvas is needed
if (this._useBufferCanvas()) {
stage = this.getStage();
bufferCanvas = stage.bufferCanvas;

View File

@@ -617,7 +617,12 @@
this.content.className = KINETICJS_CONTENT;
container.appendChild(this.content);
this.bufferCanvas = new Kinetic.SceneCanvas();
// the buffer canvas pixel ratio must be 1 because it is used as an
// intermediate canvas before copying the result onto a scene canvas.
// not setting it to 1 will result in an over compensation
this.bufferCanvas = new Kinetic.SceneCanvas({
pixelRatio: 1
});
this.bufferHitCanvas = new Kinetic.HitCanvas();
this._resizeDOM();