Skip to content

Reset picking shapes before frame rebuilds - #861

Merged
dkoes merged 1 commit into
3dmol:masterfrom
dajiaohuang:fix/issue-860-reset-clickable-picking-shapes
Oct 21, 2026
Merged

dkoes merged 1 commit into
3dmol:masterfrom
dajiaohuang:fix/issue-860-reset-clickable-picking-shapes

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Summary

GLModel.createMolObj() rebuilds geometry for the selected frame, but previously left an initialized atom's picking-shape arrays intact. The sphere and bond builders append to those arrays, so revisiting a frame retained duplicate picking shapes. Reset sphere, cylinder, line, and triangle lists for clickable/hoverable atoms before rebuilding; non-interactive atoms are unchanged. The opt-in coordinate-replay path does not rebuild and is unaffected.

Related to #860. This change addresses retained picking arrays only; it makes no claim about the separate WebGL geometry-counter or VRAM observations, which were not measured.

Validation

  • Offline synthetic check: 200 alternating frame rebuilds kept each interactive frame's shape arrays bounded; also checked the reset runs before the geometry loop.
  • node --check on the helper and Jest regression test; git diff --check.
  • The committed Jest test and TypeScript/build pipeline were not run because dependencies are absent. The full npm test pipeline generates fixture render tests and runs glcheck; rendering, GPU/context access, and external molecular data are outside this task's limits.

@dkoes dkoes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dkoes
dkoes merged commit c46c63b into 3dmol:master Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants