mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
remove unnecessary Tile clone
This commit is contained in:
parent
d33d7958f2
commit
d75c333888
1 changed files with 4 additions and 5 deletions
|
|
@ -210,7 +210,7 @@ impl Modals {
|
||||||
|
|
||||||
let portrait_scale = (modal_width / img_width).min(modal_height / img_height);
|
let portrait_scale = (modal_width / img_width).min(modal_height / img_height);
|
||||||
let landscape_scale = (modal_width / img_height).min(modal_height / img_width);
|
let landscape_scale = (modal_width / img_height).min(modal_height / img_width);
|
||||||
let bm = if portrait_scale >= 1.0 {
|
let mut bm = if portrait_scale >= 1.0 {
|
||||||
Bitmap::from(img)
|
Bitmap::from(img)
|
||||||
} else if landscape_scale >= 1.0 {
|
} else if landscape_scale >= 1.0 {
|
||||||
Bitmap::from(img).rotate90()
|
Bitmap::from(img).rotate90()
|
||||||
|
|
@ -230,15 +230,14 @@ impl Modals {
|
||||||
((Modals::MODAL_WIDTH - bm_width) / 2).try_into().unwrap(),
|
((Modals::MODAL_WIDTH - bm_width) / 2).try_into().unwrap(),
|
||||||
((Modals::MODAL_HEIGHT - bm_height) / 2).try_into().unwrap(),
|
((Modals::MODAL_HEIGHT - bm_height) / 2).try_into().unwrap(),
|
||||||
);
|
);
|
||||||
|
bm.translate(center);
|
||||||
|
|
||||||
let mut tiles: [Option<Tile>; 6] = [None; 6];
|
let mut tiles: [Option<Tile>; 6] = [None; 6];
|
||||||
for (t, tile) in bm.iter().enumerate() {
|
for (t, tile) in bm.iter().enumerate() {
|
||||||
if t >= tiles.len() {
|
if t >= tiles.len() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let mut copy = tile.clone();
|
tiles[t] = Some(*tile);
|
||||||
copy.translate(center);
|
|
||||||
tiles[t] = Some(copy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let spec = ManagedImage {
|
let spec = ManagedImage {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue