Skip to content

Commit

Permalink
Fix instance
Browse files Browse the repository at this point in the history
  • Loading branch information
remcoder committed Jan 27, 2025
1 parent f36e5ad commit 178d515
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/dom-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { WebGLPreview } from './webgl-preview';
/**
* Enables drag and drop handling for G-code files
*/
export function enableDropHandler(previewInstance: WebGLPreview, element : HTMLElement): void {
export function enableDropHandler(previewInstance: WebGLPreview, element: HTMLElement): void {
console.warn('Drag and drop is deprecated as a library feature. See the demo how to implement your own.');
element.addEventListener('dragover', (evt) => {
evt.stopPropagation();
Expand All @@ -24,10 +24,10 @@ export function enableDropHandler(previewInstance: WebGLPreview, element : HTMLE
const files: FileList | [] = evt.dataTransfer?.files ?? [];
const file = files[0];

this.clear();
previewInstance.clear();

// eslint-disable-next-line @typescript-eslint/no-explicit-any
await this.readFromStream(file.stream() );
this.render();
await previewInstance.readFromStream(file.stream());
previewInstance.render();
});
}
}
2 changes: 1 addition & 1 deletion src/webgl-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Interpreter } from './interpreter';
import { Job } from './job';
import { Path } from './path';
import { createColorMaterial } from './helpers/colorMaterial';
import { enableDropHandler } from './dom-utils';
import { enableDropHandler } from './dom-utils';

import {
BatchedMesh,
Expand Down

0 comments on commit 178d515

Please sign in to comment.