Skip to content

Fix widgets not rendering after relayout#425

Merged
floryst merged 4 commits intomainfrom
fix-widgets-after-layout
Sep 19, 2023
Merged

Fix widgets not rendering after relayout#425
floryst merged 4 commits intomainfrom
fix-widgets-after-layout

Conversation

@floryst
Copy link
Contributor

@floryst floryst commented Sep 19, 2023

Fixes #424. The views weren't requesting a render after layout changes. I also created a useWidgetVisibility composable to encapsulate this behavior.

I also cleaned up toolId prop usage by directly using the prop and typing the toolId to be PropType<ToolID>.

@floryst floryst requested a review from PaulHax September 19, 2023 13:49
@netlify
Copy link

netlify bot commented Sep 19, 2023

Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit 995963b
🔍 Latest deploy log https://app.netlify.com/sites/volview-dev/deploys/6509c7d0a1172600087510ac
😎 Deploy Preview https://deploy-preview-425--volview-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@PaulHax PaulHax left a comment

Choose a reason for hiding this comment

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

Better but still not seeing interactive widgets after switching layouts to a view that was hidden before.

Switching tool types makes existing tools ineractive again.

Adds a useWidgetVisibility composable that invokes a view render after
rendering the widgets.
Mounted needs to wait for the container to have non-zero size.

Unmounted needs to be triggered on component unmount, since the watcher
is stopped during unmounting.
Tools should be waiting for the view proxy to be mounted and ready,
rather than the component.
@floryst floryst force-pushed the fix-widgets-after-layout branch from e9e5b7d to 995963b Compare September 19, 2023 16:09
@floryst
Copy link
Contributor Author

floryst commented Sep 19, 2023

Please try again. I fixed an issue where the widgets were being added to a view of 0,0 size, which prevented proper rendering of pixel-scaled representations.

@PaulHax
Copy link
Collaborator

PaulHax commented Sep 19, 2023

Fixed now! Devious bug, I was scratching my head there.

@floryst floryst merged commit 8cb431e into main Sep 19, 2023
@floryst floryst deleted the fix-widgets-after-layout branch September 19, 2023 18:26
PaulHax pushed a commit to PaulHax/VolView that referenced this pull request Apr 24, 2025
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.

Tools not interactive after layout switch

2 participants