element/image: include the fit mode in the cache key#97
Closed
UncleJ4ck wants to merge 1 commit into
Closed
Conversation
the cached texture bakes in the fit mode, but the cache key was just the path (plus the svg/icon size), so two image elements sharing a path with different fit modes collided on one cache entry and the second drew with the first's fit. shows up with hyprpaper putting one image on two monitors with different fit_mode.
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the cached texture bakes in the fit mode, but the cache key was just the path (plus the svg/icon size), so two image elements sharing a path with different fit modes collided on one cache entry and the second drew with the first's fit. shows up with hyprpaper putting one image on two monitors with different fit_mode.
CAssetCache::getmatches bysource()equality andgetCacheStringomitted the fit mode, so the second element reused the first's texture (fitModeis baked in atuploadTexture). appendingsc<int>(data.fitMode)to the key gives each fit mode its own entry while keeping in-flight dedup for elements that share path and fit mode.STextureDatacarries onlyresourceandfitMode, so that one field is the whole class;roundingand alpha are draw-time shader uniforms and need no key change.added a unit test asserting the key differs across fit modes and matches for the same one. alternative to #96, which guarded the cache hit instead of the key.
build-tested + unit suite (37/37); the two-monitor pixel repro needs two outputs.