Skip to content

Commit

Permalink
fixup! refactor(core/rust): make use of Display trait for rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
matejcik committed Aug 28, 2024
1 parent a0778b5 commit 155c3b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/embed/rust/src/ui/component/cached_jpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl CachedJpeg {

let mut buf = unwrap!(ImageBuffer::new(size), "no image buf");

render_on_canvas(buf.canvas(), None, |target| {
render_on_canvas!(buf.canvas(), None, |target| {
shape::JpegImage::new_image(Point::zero(), image)
.with_scale(scale)
.render(target);
Expand Down
4 changes: 1 addition & 3 deletions core/embed/rust/src/ui/flow/swipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ use crate::{
flow::{base::Decision, FlowMsg, FlowState},
geometry::Rect,
layout::obj::ObjComponent,
model_mercury::ModelMercuryFeatures,
shape::{render_on_display, Display, Renderer},
shape::{render_on_display, Display},
util::animation_disabled,
UIFeaturesCommon,
},
};

Expand Down
4 changes: 2 additions & 2 deletions core/embed/rust/src/ui/model_mercury/component/homescreen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl Homescreen {
let image = get_homescreen_image();
let mut buf = unwrap!(ImageBuffer::new(AREA.size()), "no image buf");

render_on_canvas(buf.canvas(), None, |target| {
render_on_canvas!(buf.canvas(), None, |target| {
if let Some(image) = image {
shape::JpegImage::new_image(Point::zero(), image).render(target);
} else {
Expand Down Expand Up @@ -735,7 +735,7 @@ impl Lockscreen {
let image = get_homescreen_image();
let mut buf = unwrap!(ImageBuffer::new(AREA.size()), "no image buf");

render_on_canvas(buf.canvas(), None, |target| {
render_on_canvas!(buf.canvas(), None, |target| {
if let Some(image) = image {
shape::JpegImage::new_image(Point::zero(), image).render(target);
} else {
Expand Down

0 comments on commit 155c3b2

Please sign in to comment.