[BUG] Lock window size in renders - #273
Open
BorniaPedro wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
==========================================
- Coverage 94.56% 94.52% -0.04%
==========================================
Files 47 47
Lines 9144 9154 +10
==========================================
+ Hits 8647 8653 +6
- Misses 497 501 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
camUrban
force-pushed
the
issue-265-bug-resizing
branch
from
August 8, 2026 23:02
9e35ddf to
eac5a4b
Compare
Owner
|
Hi @BorniaPedro. I'm a bit busy with work at the moment, so I won't be able to review this until next week. Thank you for putting in the time to contribute, it means a lot! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Locks the render window size in
drawandanimatethrough a two-layer strategy using a VTKConfigureEventobserver during interactive phases and explicitSetSizere-assertions during non-interactive rendering passes.Motivation
Dragging, maximizing, or tile-snapping the render window after creation caused screenshots to capture at the resized live window dimensions while text sizes and line widths remained scaled to the initial requested
window_size. Additionally, window resizes during the rendering loop ofanimateresulted in frames of varying dimensions, causingwebp.save_imagesto fail deep in its CFFI layer with anAttributeError: cdata 'struct WebPAnimEncoder *' points to an opaque type. Enforcing the requested window size in both interactive and rendering phases guarantees that saved outputs consistently match the requested dimensions and styling scale.Relevant Issues
Fixes #265
Changes
ConfigureEventobserver to the interactor indrawandanimateto snap the render window back to the requested dimensions viaSetSizeupon OS-level resizes.SetSizeon the render window prior to taking the screenshot indrawand before rendering each frame inanimate.Dependency Updates
None.
Change Magnitude
Minor: Small change such as a bug fix, small enhancement, or documentation update.
Checklist (check each item when completed or not applicable)
mainand is up to date with the upstreammainbranch.--in-place --black). See the style guide for type hints and docstrings for more details.pterasoftwarepackage use type hints. See the style guide for type hints and docstrings for more details.testspackage.testspackage.ascii-only,pre-commit-hooks, andzizmorGitHub actions.lintjob of theCIGitHub action.testjobs of theCIGitHub action.