mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
Fix screenshot animation loop handling (#1660)
This commit is contained in:
@@ -124,6 +124,7 @@ Note that since we don't clearly distinguish between a public and private interf
|
||||
- Use of `KHR_parallel_shader_compile` extension when available to check status
|
||||
- Add `ShaderManager` to compile shaders based on `Canvas3D` params and `Scene` content
|
||||
- Draw `Scene` only when shaders are ready
|
||||
- Fix incorrect animation loop handling in the screenshot code
|
||||
|
||||
## [v4.18.0] - 2025-06-08
|
||||
- MolViewSpec extension:
|
||||
|
||||
@@ -362,7 +362,7 @@ export class ViewportScreenshotHelper extends PluginComponent {
|
||||
const { width, height, viewport } = this.getSizeAndViewport();
|
||||
if (width <= 0 || height <= 0) return;
|
||||
|
||||
this.plugin.canvas3d?.pause(true);
|
||||
this.plugin.animationLoop.stop({ noDraw: true });
|
||||
try {
|
||||
await ctx.update('Rendering image...');
|
||||
const pass = this.imagePass;
|
||||
@@ -377,7 +377,7 @@ export class ViewportScreenshotHelper extends PluginComponent {
|
||||
if (!canvasCtx) throw new Error('Could not create canvas 2d context');
|
||||
canvasCtx.putImageData(imageData, 0, 0);
|
||||
} finally {
|
||||
this.plugin.canvas3d?.animate();
|
||||
this.plugin.animationLoop.start({ immediate: true });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user