-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add shortcuts to toggle antialiasing #149
Conversation
src/picture_widget.rs
Outdated
pub fn toggle_antialias(&mut self) { | ||
let mut cache = self.cache.lock().unwrap(); | ||
let aa = match cache.image.antialiasing { | ||
Antialias::Auto if self.img_texel_size < 4f32 => Antialias::Never, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool
@@ -35,6 +37,8 @@ lazy_static! { | |||
m.insert(PLAY_ANIM_NAME, vec!["Alt+A", "Alt+V"]); | |||
m.insert(PLAY_PRESENT_NAME, vec!["P"]); | |||
m.insert(PLAY_PRESENT_RND_NAME, vec!["Alt+P"]); | |||
m.insert(TOGGLE_ANTIALIAS, vec!["S"]); | |||
m.insert(SET_AUTOMATIC_ANTIALIAS, vec!["Alt+S"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that this always sets to autmatic no matter what. This helps combat that sometimes the difference is barely noticable even if a changed happened in filtering.
Thanks you, this is nice; there are a few things I'd like to add
|
How do you mean? When pressing S, antialiasing is toggled irrespective of the zoom level. Or do you mean something different?
Now that I think of it, I agree that using
I'll change it back then. |
What I meant by minification was that when the image is shrunk we still use smoothing even if aa is off. But I honestly don't know if anyone would want to turn that off so let's just leave it as it is. If someone needs that, they'll open an issue.
To clarify, I was thinking of using both. The cache would remain the way you made it and the cfg would have an optional field called |
This reverts commit bb05065.
when reopening emulsion
@ArturKovacs I think I addressed all of your concerns. |
Thanks! |
This adds shortcuts to toggle antialiasing. The current value is stored in the cache file. There are three possible values:
always
– turn antialiasing onnever
– turn antialiasing offauto
– antialiasing depends on the zoom factorThere are two new key bindings:
toggle_antialias
(default S): Sets antialiasing toalways
ornever
automatic_antialias
(default Alt+S): Sets antialiasing toauto
The
cfg.toml
has a new settingimage.antialiasing
, which can have the following values:always
,never
,auto
– see aboveprevious
– restores the setting from the last sessionCloses #26