mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
fixed pixel ratio issue with buffer canvas usage
This commit is contained in:
@@ -14,6 +14,30 @@ suite('Stage', function() {
|
||||
});
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
test('test stage buffer canvas and hit buffer canvas', function() {
|
||||
var container = document.createElement('div');
|
||||
container.id = 'container';
|
||||
|
||||
kineticContainer.appendChild(container);
|
||||
|
||||
// simulate pixelRatio = 2
|
||||
Kinetic.pixelRatio = 2;
|
||||
|
||||
var stage = new Kinetic.Stage({
|
||||
container: 'container',
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
|
||||
|
||||
assert.equal(stage.bufferCanvas.getPixelRatio(), 1);
|
||||
assert.equal(stage.bufferHitCanvas.getPixelRatio(), 2);
|
||||
|
||||
// reset
|
||||
Kinetic.pixelRatio = 1;
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
test('instantiate stage with dom element', function() {
|
||||
var container = document.createElement('div');
|
||||
|
Reference in New Issue
Block a user