Skip to content

Commit

Permalink
fix(client): force id on canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Feb 19, 2024
1 parent 1dba35c commit fe7dc25
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Binary file modified trame_vtklocal/module/serve/vtkObjectManager.wasm
Binary file not shown.
Binary file modified vue-components/public/vtkObjectManager.wasm
Binary file not shown.
18 changes: 9 additions & 9 deletions vue-components/src/components/VtkLocal.js
Original file line number Diff line number Diff line change
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 All @@ -37,16 +37,16 @@ export default {
const session = client.getConnection().getSession();
const serverState = await session.call("vtklocal.get.state", [vtkId]);
stateMTimes[vtkId] = serverState.mtime;
console.log(`vtkLocal::state(${vtkId}) =`)
// console.log(`vtkLocal::state(${vtkId}) =`)
objectManager.registerState(serverState);
return serverState;
}
async function fetchHash(hash) {
const session = client.getConnection().getSession();
const blob = await session.call("vtklocal.get.hash", [hash]);
const array = new Uint8Array(await blob.arrayBuffer())
const array = new Uint8Array(await blob.arrayBuffer());
objectManager.registerBlob(hash, array);
hashesAvailable.add(hash);
objectManager.registerBlob(hash, Array.from(array)); // FIXME
return blob;
}

Expand All @@ -56,7 +56,6 @@ export default {
const serverStatus = await session.call("vtklocal.get.status", [
props.renderWindow,
]);
console.log("serverStatus", serverStatus);
const pendingRequests = [];
serverStatus.ids.forEach(([vtkId, mtime]) => {
if (!stateMTimes[vtkId] || stateMTimes[vtkId] < mtime) {
Expand All @@ -69,7 +68,6 @@ export default {
}
});
await Promise.all(pendingRequests);
// FIXME: update wasm module
console.log("vtkLocal::update(end)");
objectManager.update();
emit("updated");
Expand Down Expand Up @@ -102,11 +100,11 @@ export default {
template: `
<div ref="container" style="position: relative; width: 100%; height: 100%;">
<canvas
id="canvas"
ref="canvas"
style="position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);"
:width="canvasWidth"
:height="canvasHeight"
tabindex="0"
Expand All @@ -115,4 +113,6 @@ export default {
/>
</div>`,
};
};
// :width="canvasWidth"
// :height="canvasHeight"

0 comments on commit fe7dc25

Please sign in to comment.