File tree Expand file tree Collapse file tree 7 files changed +11
-11
lines changed Expand file tree Collapse file tree 7 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -160,13 +160,11 @@ fn run_and_return(
160
160
// Platform-dependent event handlers to workaround a winit bug
161
161
// See: https://github.com/rust-windowing/winit/issues/987
162
162
// See: https://github.com/rust-windowing/winit/issues/1619
163
- #[ cfg( target_os = "windows" ) ]
164
- winit:: event:: Event :: RedrawEventsCleared => {
163
+ winit:: event:: Event :: RedrawEventsCleared if cfg ! ( target_os = "windows" ) => {
165
164
next_repaint_time = extremely_far_future ( ) ;
166
165
winit_app. run_ui_and_paint ( )
167
166
}
168
- #[ cfg( not( target_os = "windows" ) ) ]
169
- winit:: event:: Event :: RedrawRequested ( _) => {
167
+ winit:: event:: Event :: RedrawRequested ( _) if !cfg ! ( target_os = "windows" ) => {
170
168
next_repaint_time = extremely_far_future ( ) ;
171
169
winit_app. run_ui_and_paint ( )
172
170
}
Original file line number Diff line number Diff line change @@ -448,7 +448,8 @@ pub fn warn_if_debug_build(ui: &mut crate::Ui) {
448
448
/// ui.image(egui::include_image!("../assets/ferris.png"));
449
449
/// ui.add(
450
450
/// egui::Image::new(egui::include_image!("../assets/ferris.png"))
451
- /// .rounding(egui::Rounding::same(6.0))
451
+ /// .max_width(200.0)
452
+ /// .rounding(10.0),
452
453
/// );
453
454
///
454
455
/// let image_source: egui::ImageSource = egui::include_image!("../assets/ferris.png");
Original file line number Diff line number Diff line change @@ -1560,7 +1560,8 @@ impl Ui {
1560
1560
/// ui.image(egui::include_image!("../assets/ferris.png"));
1561
1561
/// ui.add(
1562
1562
/// egui::Image::new(egui::include_image!("../assets/ferris.png"))
1563
- /// .rounding(egui::Rounding::same(6.0))
1563
+ /// .max_width(200.0)
1564
+ /// .rounding(10.0),
1564
1565
/// );
1565
1566
/// # });
1566
1567
/// ```
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ http = ["dep:ehttp"]
42
42
# #
43
43
# # You also need to ALSO opt-in to the image formats you want to support, like so:
44
44
# # ```toml
45
- # # image = { version = "0.24", features = ["jpeg", "png"] }
45
+ # # image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
46
+
46
47
# # ```
47
48
image = [" dep:image" ]
48
49
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ One thing `egui_extras` is commonly used for is to install image loaders for `eg
13
13
14
14
``` toml
15
15
egui_extras = { version = " *" , features = [" all_loaders" ] }
16
- image = { version = " 0.24" , features = [" jpeg" , " png" ] }
16
+ image = { version = " 0.24" , features = [" jpeg" , " png" ] } # Add the types you want support for
17
17
```
18
18
19
19
``` rs
Original file line number Diff line number Diff line change 20
20
///
21
21
/// ```toml,ignore
22
22
/// egui_extras = { version = "*", features = ["all_loaders"] }
23
- /// image = { version = "0.24", features = ["jpeg", "png"] }
23
+ /// image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
24
24
/// ```
25
25
///
26
26
/// ⚠ You have to configure both the supported loaders in `egui_extras` _and_ the supported image formats
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ impl eframe::App for MyApp {
29
29
ui. image ( egui:: include_image!( "ferris.svg" ) ) ;
30
30
31
31
ui. add (
32
- egui:: Image :: new ( "https://picsum.photos/seed/1.759706314/1024" )
33
- . rounding ( egui:: Rounding :: same ( 10.0 ) ) ,
32
+ egui:: Image :: new ( "https://picsum.photos/seed/1.759706314/1024" ) . rounding ( 10.0 ) ,
34
33
) ;
35
34
} ) ;
36
35
} ) ;
You can’t perform that action at this time.
0 commit comments