summaryrefslogtreecommitdiffstats
path: root/examples/gallery
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-09 06:38:48 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-09 06:38:48 +0100
commitf3ae4266e9727940ba0d0e8469362923590916f4 (patch)
tree2a6871b981c083fe01b90511b58f510da7ed9ce2 /examples/gallery
parentab236376a3f8f1ac3cdd8aeb0ffeee45e3de37e3 (diff)
downloadiced-f3ae4266e9727940ba0d0e8469362923590916f4.tar.gz
iced-f3ae4266e9727940ba0d0e8469362923590916f4.tar.bz2
iced-f3ae4266e9727940ba0d0e8469362923590916f4.zip
Implement `From<u32>` instead of `u16` for `Length` and `Pixels`
Diffstat (limited to 'examples/gallery')
-rw-r--r--examples/gallery/src/civitai.rs2
-rw-r--r--examples/gallery/src/main.rs9
2 files changed, 4 insertions, 7 deletions
diff --git a/examples/gallery/src/civitai.rs b/examples/gallery/src/civitai.rs
index c394ef1d..457091e9 100644
--- a/examples/gallery/src/civitai.rs
+++ b/examples/gallery/src/civitai.rs
@@ -125,7 +125,7 @@ impl fmt::Debug for Rgba {
#[derive(Debug, Clone, Copy)]
pub enum Size {
Original,
- Thumbnail { width: u16 },
+ Thumbnail { width: u32 },
}
#[derive(Debug, Clone)]
diff --git a/examples/gallery/src/main.rs b/examples/gallery/src/main.rs
index 6175f396..3bc66382 100644
--- a/examples/gallery/src/main.rs
+++ b/examples/gallery/src/main.rs
@@ -97,10 +97,7 @@ impl Gallery {
Task::batch(vec![
Task::perform(
- image.clone().blurhash(
- Preview::WIDTH as u32,
- Preview::HEIGHT as u32,
- ),
+ image.clone().blurhash(Preview::WIDTH, Preview::HEIGHT),
move |result| Message::BlurhashDecoded(id, result),
),
Task::perform(
@@ -313,8 +310,8 @@ enum Preview {
}
impl Preview {
- const WIDTH: u16 = 320;
- const HEIGHT: u16 = 410;
+ const WIDTH: u32 = 320;
+ const HEIGHT: u32 = 410;
fn blurhash(rgba: Rgba) -> Self {
Self::Blurhash(Blurhash {