Skip to content

Commit fa6fdd5

Browse files
committed
Fix unused dep
1 parent 7d82f4c commit fa6fdd5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

crates/egui_extras/src/image.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use egui::ColorImage;
2-
31
#[cfg(feature = "svg")]
42
use egui::SizeHint;
53

@@ -13,7 +11,7 @@ use egui::SizeHint;
1311
/// # Errors
1412
/// On invalid image or unsupported image format.
1513
#[cfg(feature = "image")]
16-
pub fn load_image_bytes(image_bytes: &[u8]) -> Result<ColorImage, egui::load::LoadError> {
14+
pub fn load_image_bytes(image_bytes: &[u8]) -> Result<egui::ColorImage, egui::load::LoadError> {
1715
profiling::function_scope!();
1816
let image = image::load_from_memory(image_bytes).map_err(|err| match err {
1917
image::ImageError::Unsupported(err) => match err.kind() {
@@ -33,7 +31,10 @@ pub fn load_image_bytes(image_bytes: &[u8]) -> Result<ColorImage, egui::load::Lo
3331
// TODO(emilk): if this is a PNG, looks for DPI info to calculate the source size,
3432
// e.g. for screenshots taken on a high-DPI/retina display.
3533

36-
Ok(ColorImage::from_rgba_unmultiplied(size, pixels.as_slice()))
34+
Ok(egui::ColorImage::from_rgba_unmultiplied(
35+
size,
36+
pixels.as_slice(),
37+
))
3738
}
3839

3940
/// Load an SVG and rasterize it into an egui image.
@@ -46,7 +47,7 @@ pub fn load_image_bytes(image_bytes: &[u8]) -> Result<ColorImage, egui::load::Lo
4647
pub fn load_svg_bytes(
4748
svg_bytes: &[u8],
4849
options: &resvg::usvg::Options<'_>,
49-
) -> Result<ColorImage, String> {
50+
) -> Result<egui::ColorImage, String> {
5051
load_svg_bytes_with_size(svg_bytes, Default::default(), options)
5152
}
5253

@@ -61,7 +62,7 @@ pub fn load_svg_bytes_with_size(
6162
svg_bytes: &[u8],
6263
size_hint: SizeHint,
6364
options: &resvg::usvg::Options<'_>,
64-
) -> Result<ColorImage, String> {
65+
) -> Result<egui::ColorImage, String> {
6566
use egui::Vec2;
6667
use resvg::{
6768
tiny_skia::Pixmap,
@@ -109,7 +110,7 @@ pub fn load_svg_bytes_with_size(
109110
&mut pixmap.as_mut(),
110111
);
111112

112-
let image = ColorImage::from_rgba_premultiplied([w as _, h as _], pixmap.data())
113+
let image = egui::ColorImage::from_rgba_premultiplied([w as _, h as _], pixmap.data())
113114
.with_source_size(source_size);
114115

115116
Ok(image)

0 commit comments

Comments
 (0)