mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
Simplify image primitives API
Removed the source rectangle as that can also be done on the source image side, if necessary.
This commit is contained in:
parent
260f17a3e0
commit
cbd28bf745
4 changed files with 6 additions and 14 deletions
|
@ -57,15 +57,12 @@ fn main() {
|
|||
|
||||
let source_size = image.dimensions();
|
||||
|
||||
let source_rect =
|
||||
Rect::new(Point::new(0.0, 0.0), Size::new(source_size.0 as f32, source_size.1 as f32));
|
||||
let dest_rect = Rect::new(
|
||||
Point::new(200.0, 200.0),
|
||||
Size::new(source_size.0 as f32, source_size.1 as f32),
|
||||
);
|
||||
|
||||
let image_primitive =
|
||||
rendering_primitives_builder.create_image_primitive(source_rect, dest_rect, image);
|
||||
let image_primitive = rendering_primitives_builder.create_image_primitive(dest_rect, image);
|
||||
|
||||
render_cache.allocate_entry(image_primitive)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue