1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Specify deifferent minification and magnification filters (#2224)

* Specify deifferent minification and magnification filters

* Fixes

* Update changelogs

* Doctest fixes

* Add deprecation notice for RetainedImage::with_texture_filter
This commit is contained in:
Emil Ernerfeldt
2022-11-02 17:54:06 +01:00
committed by GitHub
parent 8e79a5a8ae
commit 34e6e12f00
19 changed files with 147 additions and 97 deletions

View File

@@ -1,7 +1,7 @@
use std::sync::Arc;
use crate::{
emath::NumExt, mutex::RwLock, textures::TextureFilter, ImageData, ImageDelta, TextureId,
emath::NumExt, mutex::RwLock, textures::TextureOptions, ImageData, ImageDelta, TextureId,
TextureManager,
};
@@ -66,10 +66,10 @@ impl TextureHandle {
}
/// Assign a new image to an existing texture.
pub fn set(&mut self, image: impl Into<ImageData>, filter: TextureFilter) {
pub fn set(&mut self, image: impl Into<ImageData>, options: TextureOptions) {
self.tex_mngr
.write()
.set(self.id, ImageDelta::full(image.into(), filter));
.set(self.id, ImageDelta::full(image.into(), options));
}
/// Assign a new image to a subregion of the whole texture.
@@ -77,11 +77,11 @@ impl TextureHandle {
&mut self,
pos: [usize; 2],
image: impl Into<ImageData>,
filter: TextureFilter,
options: TextureOptions,
) {
self.tex_mngr
.write()
.set(self.id, ImageDelta::partial(pos, image.into(), filter));
.set(self.id, ImageDelta::partial(pos, image.into(), options));
}
/// width x height