@janovix/blocks 1.2.0-rc.20 → 1.2.0-rc.22

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.
package/dist/index.js CHANGED
@@ -3855,6 +3855,8 @@ function AvatarEditor({
3855
3855
  ctx.fillStyle = "#ffffff";
3856
3856
  ctx.fillRect(0, 0, outputSize, outputSize);
3857
3857
  }
3858
+ ctx.imageSmoothingEnabled = true;
3859
+ ctx.imageSmoothingQuality = "high";
3858
3860
  ctx.save();
3859
3861
  ctx.translate(outputSize / 2, outputSize / 2);
3860
3862
  ctx.rotate(rotation * Math.PI / 180);
@@ -3879,6 +3881,10 @@ function AvatarEditor({
3879
3881
  drawHeight
3880
3882
  );
3881
3883
  ctx.restore();
3884
+ ctx.globalCompositeOperation = "destination-in";
3885
+ ctx.beginPath();
3886
+ ctx.arc(outputSize / 2, outputSize / 2, outputSize / 2, 0, Math.PI * 2);
3887
+ ctx.fill();
3882
3888
  const mimeType = `image/${outputFormat}`;
3883
3889
  return outputCanvas.toDataURL(mimeType, outputQuality);
3884
3890
  }, [
@@ -3900,8 +3906,8 @@ function AvatarEditor({
3900
3906
  canvas.width = displaySize;
3901
3907
  canvas.height = displaySize;
3902
3908
  ctx.clearRect(0, 0, displaySize, displaySize);
3903
- ctx.fillStyle = "#1a1a2e";
3904
- ctx.fillRect(0, 0, displaySize, displaySize);
3909
+ ctx.imageSmoothingEnabled = true;
3910
+ ctx.imageSmoothingQuality = "high";
3905
3911
  ctx.save();
3906
3912
  ctx.translate(displaySize / 2, displaySize / 2);
3907
3913
  ctx.rotate(rotation * Math.PI / 180);