Implement image support for canvas widget
This commit is contained in:
parent
87a613edd1
commit
0ceee1cf3a
16 changed files with 485 additions and 29 deletions
|
|
@ -330,6 +330,7 @@ impl graphics::geometry::Renderer for Renderer {
|
|||
match geometry {
|
||||
Geometry::Live {
|
||||
primitives,
|
||||
images,
|
||||
text,
|
||||
clip_bounds,
|
||||
} => {
|
||||
|
|
@ -339,6 +340,10 @@ impl graphics::geometry::Renderer for Renderer {
|
|||
transformation,
|
||||
);
|
||||
|
||||
for image in images {
|
||||
layer.draw_image(&image, transformation);
|
||||
}
|
||||
|
||||
layer.draw_text_group(text, clip_bounds, transformation);
|
||||
}
|
||||
Geometry::Cache(cache) => {
|
||||
|
|
@ -348,6 +353,10 @@ impl graphics::geometry::Renderer for Renderer {
|
|||
transformation,
|
||||
);
|
||||
|
||||
for image in cache.images.iter() {
|
||||
layer.draw_image(image, transformation);
|
||||
}
|
||||
|
||||
layer.draw_text_cache(
|
||||
cache.text,
|
||||
cache.clip_bounds,
|
||||
|
|
@ -381,7 +390,7 @@ impl core::image::Renderer for Renderer {
|
|||
opacity: f32,
|
||||
) {
|
||||
let (layer, transformation) = self.layers.current_mut();
|
||||
layer.draw_image(
|
||||
layer.draw_raster(
|
||||
handle,
|
||||
filter_method,
|
||||
bounds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue