doc-vtk: fix scrolling

This commit is contained in:
2024-02-05 03:49:22 +00:00
parent afb41b4483
commit 2b414b51ae

View File

@@ -6,8 +6,8 @@
<style> <style>
.vtk-viewer { .vtk-viewer {
width: 100%; width: 100%;
height: 500px; height: 70%;
border: 1px solid #ddd; border: 1px solid #bbb;
} }
</style> </style>
<script src="vtk.js"></script> <script src="vtk.js"></script>
@@ -160,7 +160,7 @@
parent_element.appendChild(container); parent_element.appendChild(container);
container.addEventListener('mouseenter', enterCurrentRenderer); container.addEventListener('mouseenter', enterCurrentRenderer);
container.addEventListener('mouseleave', exitCurrentRenderer); container.addEventListener('mouseleave', exitCurrentRenderer);
// container.id = ID; container.id = ID;
renderWindow.addRenderer(renderer); renderWindow.addRenderer(renderer);
updateViewPort(container, renderer); updateViewPort(container, renderer);
@@ -189,19 +189,26 @@
"shape": pinephone_case "shape": pinephone_case
}]; }];
render(pinephone_case_options, parent_element); render(pinephone_case_options, parent_element);
</script>
</div>
<div class="vtk-viewer">
<script>
var parent_element = document.currentScript.parentNode;
var pinephone_case_with_phone_options = [{ var pinephone_case_with_phone_options = [
"color": [ 1.0, 0.8, 0.0, 1.0 ], {
"position": [ 0.0, 0.0, 0.0 ], "color": [ 1.0, 0.8, 0.0, 1.0 ],
"orientation": [ 0.0, 0.0, 0.0 ], "position": [ 0.0, 0.0, 0.0 ],
"shape": pinephone_case "orientation": [ 0.0, 0.0, 0.0 ],
}, "shape": pinephone_case
{ },
"color": [ 0.2, 0.2, 0.2, 1.0 ], {
"position": [ 0.0, 0.0, 0.0 ], "color": [ 0.2, 0.2, 0.2, 1.0 ],
"orientation": [ 0.0, 0.0, 0.0 ], "position": [ 0.0, 0.0, 0.0 ],
"shape": pinephone_phone "orientation": [ 0.0, 0.0, 0.0 ],
}]; "shape": pinephone_phone
}
];
render(pinephone_case_with_phone_options, parent_element); render(pinephone_case_with_phone_options, parent_element);
</script> </script>
</div> </div>