copper3d 4.1.1 → 4.1.2

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.
@@ -89,7 +89,24 @@ export declare class DrawToolCore {
89
89
  * Only set to 'Scroll:Zoom' — Scroll:Slice never needs a swap.
90
90
  */
91
91
  private wheelModeBeforeDrag;
92
- start: () => void;
92
+ /** The per-frame composite. `draw()` builds it (in `paintOnCanvas`); a no-op until then. */
93
+ private renderFrame;
94
+ private boundStart?;
95
+ /**
96
+ * The per-frame callback hosts register (`scene.addPreRenderCallbackFunction(nrrdTools.start)`).
97
+ *
98
+ * One function for the life of the instance. It used to BE the frame `draw()` installs, read
99
+ * at registration time, so a host that registered before `draw()` held the empty placeholder
100
+ * for good and the overlay never drew. A getter rather than a field so the prototype-built
101
+ * test doubles have it too.
102
+ */
103
+ get start(): () => void;
104
+ /**
105
+ * Skips frames until the first slice has sized the canvases. Until then the master canvas is
106
+ * 0x0, and `drawImage` of a 0x0 source throws InvalidStateError -- every frame, from inside
107
+ * the scene's render, which then skips its own WebGL draw.
108
+ */
109
+ private startFrame;
93
110
  constructor(container: HTMLElement, state: CanvasState);
94
111
  private initTools;
95
112
  private initDrawToolCore;
@@ -480,8 +480,9 @@ export declare class NrrdTools {
480
480
  private setShowInMainArea;
481
481
  private clearDictionary;
482
482
  /**
483
- * Get the DrawToolCore's start() render loop callback.
484
- * This is called by DragSliceTool's requestAnimationFrame loop.
483
+ * The per-frame callback that draws the annotation overlay; register it with the scene.
484
+ * The same function every time, so it may be registered before `draw()`. It does nothing
485
+ * until `draw()` has run and the first slice has sized the canvases.
485
486
  */
486
487
  get start(): () => void;
487
488
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "copper3d",
3
3
  "description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
4
- "version": "4.1.1",
4
+ "version": "4.1.2",
5
5
  "main": "dist/bundle.umd.js",
6
6
  "module": "dist/bundle.esm.mjs",
7
7
  "types": "dist/types/index.d.ts",