mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Add the Ability to Specify Egui Texture Filters (#1636)
Only works for egui_glow
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use egui::{color::*, widgets::color_picker::show_color, *};
|
||||
use egui::{color::*, epaint::textures::TextureFilter, widgets::color_picker::show_color, *};
|
||||
use std::collections::HashMap;
|
||||
|
||||
const GRADIENT_SIZE: Vec2 = vec2(256.0, 24.0);
|
||||
@@ -334,6 +334,7 @@ impl TextureManager {
|
||||
size: [width, height],
|
||||
pixels,
|
||||
},
|
||||
TextureFilter::Linear,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -549,8 +549,11 @@ impl ItemsDemo {
|
||||
};
|
||||
|
||||
let texture: &egui::TextureHandle = self.texture.get_or_insert_with(|| {
|
||||
ui.ctx()
|
||||
.load_texture("plot_demo", egui::ColorImage::example())
|
||||
ui.ctx().load_texture(
|
||||
"plot_demo",
|
||||
egui::ColorImage::example(),
|
||||
egui::epaint::textures::TextureFilter::Linear,
|
||||
)
|
||||
});
|
||||
let image = PlotImage::new(
|
||||
texture,
|
||||
|
||||
@@ -115,8 +115,11 @@ impl WidgetGallery {
|
||||
} = self;
|
||||
|
||||
let texture: &egui::TextureHandle = texture.get_or_insert_with(|| {
|
||||
ui.ctx()
|
||||
.load_texture("example", egui::ColorImage::example())
|
||||
ui.ctx().load_texture(
|
||||
"example",
|
||||
egui::ColorImage::example(),
|
||||
egui::epaint::textures::TextureFilter::Linear,
|
||||
)
|
||||
});
|
||||
|
||||
ui.add(doc_link_label("Label", "label,heading"));
|
||||
|
||||
Reference in New Issue
Block a user