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

Fix zero opacity case #2462

Merged
merged 4 commits into from
Feb 1, 2024
Merged

Conversation

pearcetm
Copy link
Contributor

This fix checks a TiledImage for the case that opacity === 0 and where _preload is false and aborts the tile updates if so, which stops tiles from being loaded for a fully transparent layer. Will fix the undesirable behavior described in #2461

@jetic83
Copy link
Contributor

jetic83 commented Feb 1, 2024

This does not seem to address the issue in #2461 . Rather, the opacity condition should be in tiledimage.js:294 update function.

@pearcetm
Copy link
Contributor Author

pearcetm commented Feb 1, 2024

@jetic83 Try the latest. It is now working correctly for me in my tests.

I moved the logic for checking for the zero opacity case (in conjunction with the preload option) into getDrawArea which makes it work well. I believe doing it this way will still allow any relevant events to fire about the springs updating, etc., even while the image is zero opacity (which is desirable).

@jetic83
Copy link
Contributor

jetic83 commented Feb 1, 2024

Hi @pearcetm , yes, this works for me as well, thanks!
There seems to be a minor unnecessary change in test/demo/drawercomparison.js, but otherwise, I am fine with the commit as a solution.

…preload in html and canvas drawers since that is done in tiledimage.
@pearcetm
Copy link
Contributor Author

pearcetm commented Feb 1, 2024

Great, glad you could confirm it works for you. The minor change in the demo page was just due to some tweaks I made to test this (before I realized I didn't need to change it after all).

The most recent commit also lets the new WebGLDrawer skip the entire drawing pipeline for zero-opacity images, which should help performance in the case where potentially hundreds or more TiledImages are loaded but are fully transparent. Finally, the CanvasDrawer and HTMLDrawer had logic related to the _preload status of the TiledImage which isn't needed and would be counterproductive from a performance status. Those have been fixed as well.

Thank you for pointing this out so we can get it fixed!

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

Awesome!

@iangilman iangilman merged commit 98769af into openseadragon:master Feb 1, 2024
iangilman added a commit that referenced this pull request Feb 1, 2024
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.

3 participants