mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Track original SVG size (#7098)
This fixes bugs related to how an `Image` follows the size of an SVG. We track the "source size" of each image, i.e. the original width/height of the SVG, which can be different from whatever it was rasterized as.
This commit is contained in:
@@ -696,10 +696,7 @@ impl Painter {
|
||||
for row in pixels.chunks_exact((w * 4) as usize).rev() {
|
||||
flipped.extend_from_slice(bytemuck::cast_slice(row));
|
||||
}
|
||||
egui::ColorImage {
|
||||
size: [w as usize, h as usize],
|
||||
pixels: flipped,
|
||||
}
|
||||
egui::ColorImage::new([w as usize, h as usize], flipped)
|
||||
}
|
||||
|
||||
pub fn read_screen_rgb(&self, [w, h]: [u32; 2]) -> Vec<u8> {
|
||||
|
||||
Reference in New Issue
Block a user