Skip to content

fix(pinner): make pinToTop robust for pinned Placeholders - #27

Merged
daedeloth merged 2 commits into
masterfrom
pinner-connect-qr-fixes
Jul 14, 2026
Merged

fix(pinner): make pinToTop robust for pinned Placeholders#27
daedeloth merged 2 commits into
masterfrom
pinner-connect-qr-fixes

Conversation

@daedeloth

Copy link
Copy Markdown
Member

A Placeholder pinned above another layer (the connect-screen QR over the flung-emoji layer) was being defeated at several points:

  • Placeholder.updateZIndex re-inserted the inner placeholder next to its source element every tick, dragging it back out of the pin layer. Skip that reordering when the placeholder is pinned (obj._pinnedToTop, set by Pinner on pin and cleared on _restore).
  • _syncRecord read the anchor's concatenated matrix without guarding, which threw ("reading 'x' of undefined") and broke the tick loop while the anchor subtree was still being built. Guard it and skip the frame.
  • getBounds() (optional, only for bounds-sizing children) was bundled into the same read as the matrices, so a MovieClip anchor whose getBounds() throws persistently made _syncRecord bail every frame and left the pin stuck at the pin-container origin. Read bounds in its own try/catch so a throw there never blocks positioning.

Adds tools/pin-placeholder-test.js covering the z-index case and extends pin-test.js to assert positioning survives a persistently-throwing getBounds().

daedeloth and others added 2 commits July 14, 2026 23:27
A Placeholder pinned above another layer (the connect-screen QR over the
flung-emoji layer) was being defeated at several points:

- Placeholder.updateZIndex re-inserted the inner placeholder next to its
  source element every tick, dragging it back out of the pin layer.
  Skip that reordering when the placeholder is pinned (obj._pinnedToTop,
  set by Pinner on pin and cleared on _restore).
- _syncRecord read the anchor's concatenated matrix without guarding,
  which threw ("reading 'x' of undefined") and broke the tick loop while
  the anchor subtree was still being built. Guard it and skip the frame.
- getBounds() (optional, only for bounds-sizing children) was bundled
  into the same read as the matrices, so a MovieClip anchor whose
  getBounds() throws persistently made _syncRecord bail every frame and
  left the pin stuck at the pin-container origin. Read bounds in its own
  try/catch so a throw there never blocks positioning.

Adds tools/pin-placeholder-test.js covering the z-index case and extends
pin-test.js to assert positioning survives a persistently-throwing
getBounds().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ixes

# Conflicts:
#	app/scripts/CatLab/Easelbone/EaselJS/Pinner.js
#	dist/scripts/easelbone.js
@github-actions

Copy link
Copy Markdown

📦 PR Preview deployed!

Examples are available at:

@daedeloth
daedeloth merged commit 3e35958 into master Jul 14, 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.

1 participant