@liquid-js/qr-code-styling 4.0.0-2 → 4.0.0-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,7 +50,7 @@ CornerDotType.classy = "classy", CornerDotType.outpoint = "outpoint", CornerDotT
50
50
  CornerSquareType.extraRounded = "extra-rounded", CornerSquareType.classy = "classy",
51
51
  CornerSquareType.outpoint = "outpoint", CornerSquareType.inpoint = "inpoint", (ShapeType = ShapeType || (ShapeType = {})).square = "square",
52
52
  ShapeType.circle = "circle", (ImageMode = ImageMode || (ImageMode = {})).center = "center",
53
- ImageMode.background = "background";
53
+ ImageMode.overlay = "overlay", ImageMode.background = "background";
54
54
 
55
55
  let defaultOptions = {
56
56
  document: void 0,
@@ -878,13 +878,18 @@ class QRSVG {
878
878
  margin: imageOptions.margin
879
879
  });
880
880
  }
881
- this.drawBackground(), this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
881
+ this.drawBackground(), this.options.imageOptions.mode != ImageMode.overlay && this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
882
882
  width: drawImageSize.width,
883
883
  height: drawImageSize.height,
884
884
  count,
885
885
  dotSize
886
886
  }), this.drawDots(((i, j) => !(this.options.imageOptions.mode == ImageMode.center && i >= (count - drawImageSize.hideXDots) / 2 && i < (count + drawImageSize.hideXDots) / 2 && j >= (count - drawImageSize.hideYDots) / 2 && j < (count + drawImageSize.hideYDots) / 2 || 8 > i && 8 > j || i >= count - 8 && 8 > j || j >= count - 8 && 8 > i))),
887
- this.drawCorners();
887
+ this.options.imageOptions.mode == ImageMode.overlay && this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
888
+ width: drawImageSize.width,
889
+ height: drawImageSize.height,
890
+ count,
891
+ dotSize
892
+ }), this.drawCorners();
888
893
  }
889
894
  drawBackground() {
890
895
  let options = this.options;