Skip to content

Commit

Permalink
fix(resize): allow initial size
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Feb 19, 2024
1 parent fe7dc25 commit a8ffd63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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 } from "vue";
import { inject, ref, unref, onMounted, onBeforeUnmount, nextTick } from "vue";
import { createModule } from "../utils";

export default {
Expand Down Expand Up @@ -28,7 +28,7 @@ export default {
canvasHeight.value = height;
console.log(`vtkLocal::resize ${width}x${height}`);
// objectManager.update();
window.dispatchEvent(new Event("resize"));
// window.dispatchEvent(new Event("resize"));
// FIXME: call setSize on vtkRenderWindow
}
let resizeObserver = new ResizeObserver(resize);
Expand Down Expand Up @@ -79,6 +79,7 @@ export default {
console.log("objectManager", objectManager);
resizeObserver.observe(unref(container));
update();
setTimeout(() => window.dispatchEvent(new Event("resize")), 100);
});

onBeforeUnmount(() => {
Expand Down

0 comments on commit a8ffd63

Please sign in to comment.