fix tests for HDPI

This commit is contained in:
Anton Lavrenov 2019-01-21 17:50:42 -05:00
parent 7aa3c3238d
commit d49ee3dff1
3 changed files with 1322 additions and 52 deletions

1361
konva.js

File diff suppressed because it is too large Load Diff

View File

@ -111,6 +111,6 @@ suite('Blob', function() {
layer.add(blob);
stage.add(layer);
cloneAndCompareLayer(layer, 100);
cloneAndCompareLayer(layer, 150);
});
});

View File

@ -114,6 +114,7 @@ suite('Line', function() {
// ======================================================
test('add line with shadow', function() {
Konva.pixelRatio = 1;
var stage = addStage();
var layer = new Konva.Layer();
@ -146,9 +147,9 @@ suite('Line', function() {
context.strokeStyle = 'blue';
context.shadowColor = 'rgba(0,0,0,0.5)';
context.shadowBlur = 40;
context.shadowOffsetX = 20;
context.shadowOffsetY = 20;
context.shadowBlur = 20;
context.shadowOffsetX = 10;
context.shadowOffsetY = 10;
context.moveTo(73, 160);
context.lineTo(340, 23);
@ -156,6 +157,8 @@ suite('Line', function() {
// context.fill();
context.restore();
Konva.pixelRatio = undefined;
compareLayerAndCanvas(layer, canvas, 50);
var trace = layer.getContext().getTrace();
@ -309,7 +312,7 @@ suite('Line', function() {
assert.equal(rect.height, 52, 'check height');
});
test.only('line caching', function() {
test('line caching', function() {
// Konva.pixelRatio = 1;
var stage = addStage();
var layer = new Konva.Layer();