@netless/app-slide 0.2.38 → 0.2.39-alpha.1

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/main.es.js CHANGED
@@ -38638,8 +38638,8 @@ class SlideDocsViewer {
38638
38638
  resizeCanvas.width = pdfWidth;
38639
38639
  resizeCanvas.height = pdfHeight;
38640
38640
  const whiteSnapshotCanvas = document.createElement("canvas");
38641
- whiteSnapshotCanvas.width = width;
38642
- whiteSnapshotCanvas.height = height;
38641
+ whiteSnapshotCanvas.width = pdfWidth;
38642
+ whiteSnapshotCanvas.height = pdfHeight;
38643
38643
  const whiteCtx = whiteSnapshotCanvas.getContext("2d");
38644
38644
  if (!whiteCtx || !this.getWhiteSnapshot || !resizeCtx) {
38645
38645
  this.reportProgress(100, null);
@@ -38664,8 +38664,8 @@ class SlideDocsViewer {
38664
38664
  await new Promise((resolve) => img.onload = resolve);
38665
38665
  resizeCtx.drawImage(img, 0, 0, pdfWidth, pdfHeight);
38666
38666
  }
38667
- whiteCtx.clearRect(0, 0, width, height);
38668
- this.getWhiteSnapshot(i, whiteSnapshotCanvas, whiteCtx);
38667
+ whiteCtx.clearRect(0, 0, pdfWidth, pdfHeight);
38668
+ this.getWhiteSnapshot(i, whiteSnapshotCanvas, whiteCtx, width, height);
38669
38669
  try {
38670
38670
  const whiteSnapshot = whiteSnapshotCanvas.toDataURL("image/png");
38671
38671
  const whiteImg = document.createElement("img");
@@ -38809,14 +38809,11 @@ class SlideDocsViewer {
38809
38809
  wrapClassName(className) {
38810
38810
  return `${this.namespace}-${className}`;
38811
38811
  }
38812
- getWhiteSnapshot(pageIndex, canvas, ctx) {
38813
- const { width, height } = this.whiteboardView.size;
38814
- canvas.width = width;
38815
- canvas.height = height;
38816
- this.whiteboardView.screenshotToCanvas(ctx, `${this.baseScenePath}/${pageIndex}`, width, height, {
38812
+ getWhiteSnapshot(pageIndex, canvas, ctx, slideWidth, slideHeight) {
38813
+ this.whiteboardView.screenshotToCanvas(ctx, `${this.baseScenePath}/${pageIndex}`, canvas.width, canvas.height, {
38817
38814
  centerX: 0,
38818
38815
  centerY: 0,
38819
- scale: this.whiteboardView.camera.scale
38816
+ scale: Math.min(canvas.width / slideWidth, canvas.height / slideHeight)
38820
38817
  });
38821
38818
  }
38822
38819
  reportProgress(progress, result) {
@@ -39067,7 +39064,7 @@ class SlidePreviewer {
39067
39064
  }
39068
39065
  }
39069
39066
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
39070
- const version = "0.2.38";
39067
+ const version = "0.2.39-alpha.1";
39071
39068
  const SlideApp = {
39072
39069
  kind: "Slide",
39073
39070
  setup(context) {