mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
update toDataURL test
This commit is contained in:
parent
3336caf8e3
commit
429ef19a93
@ -280,7 +280,7 @@ suite('Node', function() {
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
test.only('toDataURL + HDPI', function(done) {
|
||||
test('toDataURL + HDPI', function(done) {
|
||||
var oldRatio = Konva.pixelRatio;
|
||||
Konva.pixelRatio = 2;
|
||||
|
||||
@ -302,15 +302,18 @@ suite('Node', function() {
|
||||
stage.draw();
|
||||
stage.toDataURL({
|
||||
callback : function(url) {
|
||||
console.log(url);
|
||||
var img = new Image();
|
||||
img.onload = function() {
|
||||
var image = new Konva.Image({
|
||||
image : img
|
||||
image : img,
|
||||
scaleX: 0.5,
|
||||
scaleY: 0.5
|
||||
});
|
||||
assert.equal(image.width(), stage.width() * 2, 'image has double size');
|
||||
layer2.add(image);
|
||||
layer2.draw();
|
||||
compareLayers(layer, layer2);
|
||||
Konva.pixelRatio = oldRatio;
|
||||
done();
|
||||
}
|
||||
img.src = url;
|
||||
|
Loading…
Reference in New Issue
Block a user