Repository navigation
[enhancement] Expose smooth scaling options in viewer settings UI - #117
Open
blakewilliams1 wants to merge 1 commit into
Open
blakewilliams1 wants to merge 1 commit into
blakewilliams1 wants to merge 1 commit into
Conversation
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.
This adds an existing setting to the Settings context drawer called "Smooth scaling", which as it suggests it determines how to interpolate the image when zooming in more than 100%. It uses the existing property called "smooth_scaling" on the ViewerConfig struct, which was unused up till this PR. By default, the interpolation is and has always been Linear and toggling smooth scaling off changes it to Nearest Neighbor. Using Nearest Neighbor is often preferable when viewing very small images and pixel art.
Here it is in use with the user's choice persisting across instances of cosmic-viewer being opened:
Kooha-2026-11-20-00-28-29.webm
There are the only 2 options that the iced Renderer::FilterMethod class comes with, and coincidentally ViewerConfig.smooth_scaling is a boolean exactly aligned to have a name and default value aligned with that enum from Renderer.
Related to issue here: #115