Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have opacity set annotation batch as dirty #259

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

Carifio24
Copy link
Member

While working on glue-viz/glue-wwt#96, I noticed some issues with changing the opacity of the line, even though we added support for annotation opacity in #238. Since the opacity would update when other properties were changed, I realized that the issue is that we don't mark the annotation batch as dirty when opacity is updated. This means that opacity updates are only realized after another property that does mark the batch as dirty has been changed. This PR remedies this by marking the batch as dirty when the opacity has changed.

Do we also want to do the same thing for the Label and ShowHoverLabel properties? It seems like we would, but I don't know enough about what these are used for.

@pkgw
Copy link
Contributor

pkgw commented Jun 30, 2023

Good catch. As for Label and ShowHoverLabel, I don't know off the top of my head. Setting the dirty flag causes various cached properties of the batch to be recomputed on the next render cycle, so you need to set it whenever any property changes that invalidates those cached properties. Those label settings (presumably!) affect the rendering, but if they don't rely on the precomputed properties, it should be OK not to set the dirty flag.

@Carifio24
Copy link
Member Author

I assume by precomputed properties you mean the lists of primitives defined here? If so, it doesn't look like either of the label values affect those - it looks like the Label of the relevant annotation (if there is one) is used to determine the hover text here. As for ShowHoverLabel, I actually don't see it being used anywhere. So yeah, no need to mark the batch as dirty for either.

@pkgw
Copy link
Contributor

pkgw commented Jun 30, 2023

Yeah; empirically, it's just "the list of things that are recalculated when BatchDirty is true" :-) So it looks like this is fine as-is.

@pkgw pkgw merged commit 7073e82 into WorldWideTelescope:master Jun 30, 2023
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