diff options
| author | 2024-05-08 19:16:20 +0900 | |
|---|---|---|
| committer | 2024-05-08 19:16:20 +0900 | |
| commit | ff26fb7df43bd241253af85e0621e2cc030e9cec (patch) | |
| tree | 2b3272bb178f8757169511966589fe6a106733f4 /examples/pokedex/src | |
| parent | 0ebe0629cef37aee5c48b9409fc36618a3a3e60d (diff) | |
| parent | 477887b3870aa5fbdab96c3a06f3b930462d7842 (diff) | |
| download | iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.tar.gz iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.tar.bz2 iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.zip  | |
Merge branch 'iced-rs-master' into viewer_content_fit
Diffstat (limited to 'examples/pokedex/src')
| -rw-r--r-- | examples/pokedex/src/main.rs | 11 | 
1 files changed, 3 insertions, 8 deletions
diff --git a/examples/pokedex/src/main.rs b/examples/pokedex/src/main.rs index 0811c08d..be20094d 100644 --- a/examples/pokedex/src/main.rs +++ b/examples/pokedex/src/main.rs @@ -1,5 +1,5 @@  use iced::futures; -use iced::widget::{self, column, container, image, row, text}; +use iced::widget::{self, center, column, image, row, text};  use iced::{Alignment, Command, Element, Length};  pub fn main() -> iced::Result { @@ -83,12 +83,7 @@ impl Pokedex {              .align_items(Alignment::End),          }; -        container(content) -            .width(Length::Fill) -            .height(Length::Fill) -            .center_x() -            .center_y() -            .into() +        center(content).into()      }  } @@ -188,7 +183,7 @@ impl Pokemon {          {              let bytes = reqwest::get(&url).await?.bytes().await?; -            Ok(image::Handle::from_memory(bytes)) +            Ok(image::Handle::from_bytes(bytes))          }          #[cfg(target_arch = "wasm32")]  | 
