Hit detect everything with a pixel ratio of 1

This commit is contained in:
Andreas Hocevar
2020-07-27 19:56:35 +02:00
parent cad5057a96
commit ac5f52a21f
7 changed files with 50 additions and 71 deletions
+6 -6
View File
@@ -12,8 +12,8 @@ describe('ol.style.Circle', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// no hit-detection image is created, because no fill style is set
expect(style.getImage(1)).to.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});
@@ -30,8 +30,8 @@ describe('ol.style.Circle', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// hit-detection image is created, because transparent fill style is set
expect(style.getImage(1)).to.not.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.not.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});
@@ -48,8 +48,8 @@ describe('ol.style.Circle', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// no hit-detection image is created, because non-transparent fill style is set
expect(style.getImage(1)).to.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});
});