@cornerstonejs/adapters 1.63.1 → 1.63.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.
@@ -46568,7 +46568,7 @@ class CanvasActor {
46568
46568
  let indicesToDelete;
46569
46569
  for (const run of row) {
46570
46570
  const {
46571
- start: start,
46571
+ start,
46572
46572
  end,
46573
46573
  value: segmentIndex
46574
46574
  } = run;
@@ -46594,7 +46594,7 @@ class CanvasActor {
46594
46594
  }
46595
46595
  const dirtyWidth = dirtyX2 - dirtyX;
46596
46596
  const dirtyHeight = dirtyY2 - dirtyY;
46597
- localContext.putImageData(imageData, 0, 0, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
46597
+ localContext.putImageData(imageData, 0, 0, dirtyX - 1, dirtyY - 1, dirtyWidth + 2, dirtyHeight + 2);
46598
46598
  context.drawImage(canvas, dirtyX, dirtyY, dirtyWidth, dirtyHeight, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
46599
46599
  }
46600
46600
  render(viewport, context) {
@@ -46818,6 +46818,7 @@ class VideoViewport extends Viewport$1 {
46818
46818
  time: this.videoElement.currentTime,
46819
46819
  duration: this.videoElement.duration
46820
46820
  });
46821
+ this.initialRender?.();
46821
46822
  const frame = this.getFrameNumber();
46822
46823
  if (this.isPlaying) {
46823
46824
  if (frame < this.frameRange[0]) {
@@ -46844,6 +46845,7 @@ class VideoViewport extends Viewport$1 {
46844
46845
  this.videoElement = document.createElement('video');
46845
46846
  this.videoElement.muted = this.mute;
46846
46847
  this.videoElement.loop = this.loop;
46848
+ this.videoElement.autoplay = true;
46847
46849
  this.videoElement.crossOrigin = 'anonymous';
46848
46850
  this.addEventListeners();
46849
46851
  this.resize();
@@ -46928,13 +46930,16 @@ class VideoViewport extends Viewport$1 {
46928
46930
  this.fps = cineRate;
46929
46931
  this.numberOfFrames = numberOfFrames;
46930
46932
  this.setFrameRange([1, numberOfFrames]);
46931
- this.play();
46933
+ this.initialRender = () => {
46934
+ this.initialRender = null;
46935
+ this.pause();
46936
+ this.setFrameNumber(frameNumber || 1);
46937
+ };
46932
46938
  return new Promise(resolve => {
46933
46939
  window.setTimeout(() => {
46934
- this.pause();
46935
46940
  this.setFrameNumber(frameNumber || 1);
46936
46941
  resolve(this);
46937
- }, 100);
46942
+ }, 25);
46938
46943
  });
46939
46944
  });
46940
46945
  }
@@ -47208,6 +47213,7 @@ class VideoViewport extends Viewport$1 {
47208
47213
  const panWorldDelta = [(focalPointCanvas[0] - canvasCenter[0]) / this.videoCamera.parallelScale, (focalPointCanvas[1] - canvasCenter[1]) / this.videoCamera.parallelScale];
47209
47214
  this.videoCamera.panWorld = [this.videoCamera.panWorld[0] - panWorldDelta[0], this.videoCamera.panWorld[1] - panWorldDelta[1]];
47210
47215
  }
47216
+ this.canvasContext.fillStyle = 'rgba(0,0,0,1)';
47211
47217
  this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height);
47212
47218
  if (this.isPlaying === false) {
47213
47219
  this.renderFrame();
@@ -49615,6 +49621,9 @@ function distanceToPointSquared(p1, p2) {
49615
49621
  }
49616
49622
 
49617
49623
  function getSignedArea(polyline) {
49624
+ if (polyline.length < 3) {
49625
+ return 0;
49626
+ }
49618
49627
  const refPoint = polyline[0];
49619
49628
  let area = 0;
49620
49629
  for (let i = 0, len = polyline.length; i < len; i++) {