Skip to content

Commit

Permalink
renamed canvasOne to workerCanvas, moved drawWafer inside a better if
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan1928 committed Mar 21, 2024
1 parent c59a1ce commit 0e25e4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/nimble-components/src/wafer-map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class WaferMap extends FoundationElement {
/**
* @internal
*/
public readonly canvasOne!: HTMLCanvasElement;
public readonly workerCanvas!: HTMLCanvasElement;

/**
* @internal
Expand Down Expand Up @@ -209,7 +209,7 @@ export class WaferMap extends FoundationElement {
const { matrixRenderer } = await createMatrixRenderer();
this.worker = matrixRenderer;

const offscreenOne = this.canvasOne.transferControlToOffscreen();
const offscreenOne = this.workerCanvas.transferControlToOffscreen();
await this.worker.setCanvas(
transfer(offscreenOne, [offscreenOne as unknown as Transferable])
);
Expand Down Expand Up @@ -252,6 +252,7 @@ export class WaferMap extends FoundationElement {
if (this.waferMapUpdateTracker.requiresContainerDimensionsUpdate) {
this.dataManager.updateContainerDimensions();
this.renderer.updateSortedDiesAndDrawWafer();
await this.drawWafer();
} else if (this.waferMapUpdateTracker.requiresScalesUpdate) {
this.dataManager.updateScales();
this.renderer.updateSortedDiesAndDrawWafer();
Expand All @@ -268,7 +269,6 @@ export class WaferMap extends FoundationElement {
} else if (this.waferMapUpdateTracker.requiresDrawnWaferUpdate) {
await this.renderer.drawWafer();
}
await this.drawWafer();
this.zoomHandler.connect();
} else if (this.waferMapUpdateTracker.requiresRenderHoverUpdate) {
this.renderer.renderHover();
Expand Down
2 changes: 1 addition & 1 deletion packages/nimble-components/src/wafer-map/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const template = html<WaferMap>`
</g>
</svg>
<canvas class="wafer-map-canvas" ${ref('canvas')}></canvas>
<canvas class="wafer-map-canvas" ${ref('canvasOne')}></canvas>
<canvas class="wafer-map-canvas" ${ref('workerCanvas')}></canvas>
<svg class="hover-layer">
<rect
class="hover-rect ${x => x.hoverOpacity}"
Expand Down

0 comments on commit 0e25e4a

Please sign in to comment.