Repository navigation
Conversation
A View on each Wallpaper picks which part shows: a zoom from 1 up, and a centre in the image that moves in as far as it must to keep the screen covered. OutputRenderState::set_pan moves the centre across the image instead, for following a launcher's pages. The shader's crop takes the centre, and the portal and dissolve trails work out what's on screen from the same Crop. A wallpaper bigger than the GPU's largest texture is now shrunk to fit on upload, since a wide photo shrunk to a tall screen can be.
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 renderer always showed the middle of the image, cropped to the screen, so this teaches it to show any part.
View(public): a zoom from 1 up and a centre in image uv. EachWallpapercarries one (View::default()shows the middle, as before), andOutputRenderState::set_viewchanges it liveOutputRenderState::set_pan: from 0 to 1, the horizontal centre runs from as far left as the image allows to as far right, in place of the view's own.Nonestops panningzoomis never below 1croptakes the centre, via two new uniforms,uv_centerandnext_uv_center. The portal and dissolve trails go through aCropthat matches it, so they still start from what's on screenstep_and_writereports a change of view or pan, so it gets drawnshiftpaperd doesn't use any of this yet, so it looks the same.
Format, clippy and tests pass locally. There are new tests for the view's zoom and clamping, for panning, and for the GPU size limit, and the portal reach test now also runs zoomed in off centre.