1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Add texture filters to changelogs and improve docs

This commit is contained in:
Emil Ernerfeldt
2022-05-22 17:32:38 +02:00
parent 1a9a0d7ec8
commit cc148ca895
4 changed files with 41 additions and 30 deletions

View File

@@ -136,11 +136,20 @@ pub struct TextureMeta {
pub filter: TextureFilter,
}
/// How the texture texels are filtered.
#[derive(Copy, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum TextureFilter {
Linear,
/// Show the nearest pixel value.
///
/// When zooming in you will get sharp, square pixels/texels.
/// When zooming out you will get a very crisp (and aliased) look.
Nearest,
/// Linearly interpolate the nearest neighbors, creating a smoother look when zooming in and out.
///
/// This is the default.
Linear,
}
impl Default for TextureFilter {