mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
fix tests for HDPI
This commit is contained in:
@@ -111,6 +111,6 @@ suite('Blob', function() {
|
|||||||
layer.add(blob);
|
layer.add(blob);
|
||||||
stage.add(layer);
|
stage.add(layer);
|
||||||
|
|
||||||
cloneAndCompareLayer(layer, 100);
|
cloneAndCompareLayer(layer, 150);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -114,6 +114,7 @@ suite('Line', function() {
|
|||||||
|
|
||||||
// ======================================================
|
// ======================================================
|
||||||
test('add line with shadow', function() {
|
test('add line with shadow', function() {
|
||||||
|
Konva.pixelRatio = 1;
|
||||||
var stage = addStage();
|
var stage = addStage();
|
||||||
var layer = new Konva.Layer();
|
var layer = new Konva.Layer();
|
||||||
|
|
||||||
@@ -146,9 +147,9 @@ suite('Line', function() {
|
|||||||
context.strokeStyle = 'blue';
|
context.strokeStyle = 'blue';
|
||||||
|
|
||||||
context.shadowColor = 'rgba(0,0,0,0.5)';
|
context.shadowColor = 'rgba(0,0,0,0.5)';
|
||||||
context.shadowBlur = 40;
|
context.shadowBlur = 20;
|
||||||
context.shadowOffsetX = 20;
|
context.shadowOffsetX = 10;
|
||||||
context.shadowOffsetY = 20;
|
context.shadowOffsetY = 10;
|
||||||
context.moveTo(73, 160);
|
context.moveTo(73, 160);
|
||||||
context.lineTo(340, 23);
|
context.lineTo(340, 23);
|
||||||
|
|
||||||
@@ -156,6 +157,8 @@ suite('Line', function() {
|
|||||||
// context.fill();
|
// context.fill();
|
||||||
context.restore();
|
context.restore();
|
||||||
|
|
||||||
|
Konva.pixelRatio = undefined;
|
||||||
|
|
||||||
compareLayerAndCanvas(layer, canvas, 50);
|
compareLayerAndCanvas(layer, canvas, 50);
|
||||||
|
|
||||||
var trace = layer.getContext().getTrace();
|
var trace = layer.getContext().getTrace();
|
||||||
@@ -309,7 +312,7 @@ suite('Line', function() {
|
|||||||
assert.equal(rect.height, 52, 'check height');
|
assert.equal(rect.height, 52, 'check height');
|
||||||
});
|
});
|
||||||
|
|
||||||
test.only('line caching', function() {
|
test('line caching', function() {
|
||||||
// Konva.pixelRatio = 1;
|
// Konva.pixelRatio = 1;
|
||||||
var stage = addStage();
|
var stage = addStage();
|
||||||
var layer = new Konva.Layer();
|
var layer = new Konva.Layer();
|
||||||
|
Reference in New Issue
Block a user