ntk 8.12.8 → 8.12.9

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.
@@ -4637,6 +4637,8 @@ class RenderingContext2d {
4637
4637
  1,
4638
4638
  ]);
4639
4639
  picture.setFilter("bilinear");
4640
+ // the edge clamped, as drawImage's scaled path explains
4641
+ R.ChangePicture(picture.id, { repeat: 2 }); // Repeat.Pad
4640
4642
  }
4641
4643
  // with a transform in place the mask is already sampled from (sx, sy)
4642
4644
  const mx = scaled ? 0 : sx;
@@ -4756,6 +4758,7 @@ class RenderingContext2d {
4756
4758
  // restore defaults so the cached surface stays reusable as-is
4757
4759
  R.SetPictureTransform(picture.id, [1, 0, 0, 0, 1, 0, 0, 0, 1]);
4758
4760
  picture.setFilter("nearest");
4761
+ R.ChangePicture(picture.id, { repeat: 0 }); // Repeat.None
4759
4762
  }
4760
4763
  this._markDirty();
4761
4764
  }
@@ -4814,6 +4817,16 @@ class RenderingContext2d {
4814
4817
  1,
4815
4818
  ]);
4816
4819
  picture.setFilter("bilinear");
4820
+ // Bilinear sampling at the rim reads half a source pixel past the
4821
+ // image, and a picture's default repeat reads transparent there: an
4822
+ // upscaled image faded into whatever it was drawn over across its
4823
+ // outer pixels — three of them for a 15-pixel swatch drawn at 96.
4824
+ // The canvas spec's drawImage clamps to the image's edge, and so do
4825
+ // browsers; RepeatPad is that. Only on this axis-aligned path, whose
4826
+ // composite box is the destination rectangle exactly: under a
4827
+ // rotation the box is the bounding box, and pad would paint its
4828
+ // corners.
4829
+ this.Render.ChangePicture(picture.id, { repeat: 2 }); // Repeat.Pad
4817
4830
  this.Render.Composite(
4818
4831
  op,
4819
4832
  picture.id,
@@ -4834,6 +4847,7 @@ class RenderingContext2d {
4834
4847
  [1, 0, 0, 0, 1, 0, 0, 0, 1],
4835
4848
  );
4836
4849
  picture.setFilter("nearest");
4850
+ this.Render.ChangePicture(picture.id, { repeat: 0 }); // Repeat.None
4837
4851
  } else {
4838
4852
  this.Render.Composite(
4839
4853
  op,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ntk",
3
- "version": "8.12.8",
3
+ "version": "8.12.9",
4
4
  "description": "Desktop UI toolkit for X11 with canvas-like 2d and OpenGL rendering",
5
5
  "author": "Andrey Sidorov <sidorares@yandex.ru>",
6
6
  "license": "MIT",