1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

feat: add a way to provide customable scaling to SVG rasterization (#2252)

This commit is contained in:
blusk
2022-11-07 10:52:14 -05:00
committed by GitHub
parent b3ab47a594
commit 3805a3282f
3 changed files with 58 additions and 18 deletions

View File

@@ -25,9 +25,10 @@ struct MyApp {
impl Default for MyApp {
fn default() -> Self {
Self {
svg_image: egui_extras::RetainedImage::from_svg_bytes(
svg_image: egui_extras::RetainedImage::from_svg_bytes_with_size(
"rustacean-flat-happy.svg",
include_bytes!("rustacean-flat-happy.svg"),
egui_extras::image::FitTo::Original,
)
.unwrap(),
}
@@ -43,7 +44,7 @@ impl eframe::App for MyApp {
ui.separator();
let max_size = ui.available_size();
self.svg_image.show_max_size(ui, max_size);
self.svg_image.show_size(ui, max_size);
});
}
}