Skip to content

Commit

Permalink
feat(resize): fix size conflict by forwarding canvas size to wasm vtk…
Browse files Browse the repository at this point in the history
… render window.
  • Loading branch information
jspanchu committed Feb 26, 2024
1 parent 86c5789 commit 7281930
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions vue-components/src/components/VtkLocal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject, ref, unref, onMounted, onBeforeUnmount, nextTick } from "vue";
import { inject, ref, unref, onMounted, onBeforeUnmount } from "vue";
import { createModule } from "../utils";

export default {
Expand Down Expand Up @@ -27,9 +27,11 @@ export default {
canvasWidth.value = width;
canvasHeight.value = height;
console.log(`vtkLocal::resize ${width}x${height}`);
// objectManager.update();
// window.dispatchEvent(new Event("resize"));
// FIXME: call setSize on vtkRenderWindow
if (props.renderWindow.length > 0)
{
objectManager.setSize(props.renderWindow, width, height);
objectManager.render(props.renderWindow);
}
}
let resizeObserver = new ResizeObserver(resize);

Expand Down Expand Up @@ -80,6 +82,7 @@ export default {
await Promise.all(pendingRequests);
console.log("vtkLocal::update(end)");
objectManager.update(startEventLoop);
resize();
emit("updated");
}

Expand Down

0 comments on commit 7281930

Please sign in to comment.