diff --git a/CHANGELOG.md b/CHANGELOG.md index 565efc10c..ec3695cfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/src/mol-plugin/util/viewport-screenshot.ts b/src/mol-plugin/util/viewport-screenshot.ts index 711dd462c..83cca4fab 100644 --- a/src/mol-plugin/util/viewport-screenshot.ts +++ b/src/mol-plugin/util/viewport-screenshot.ts @@ -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; }