mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
fixed pixel ratio issue with buffer canvas usage
This commit is contained in:
@@ -214,7 +214,7 @@
|
||||
that._animationLoop();
|
||||
}
|
||||
};
|
||||
RAF = (function() {
|
||||
var RAF = (function() {
|
||||
return window.requestAnimationFrame
|
||||
|| window.webkitRequestAnimationFrame
|
||||
|| window.mozRequestAnimationFrame
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user