made painter actually how I wanted it (draw now takes in an owned painter)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
use image::DynamicImage;
|
||||
|
||||
use crate::{Color, TextureHandle, Widget, WidgetFnRet, render::RectPrimitive};
|
||||
use crate::{Color, Painter, TextureHandle, Widget, WidgetFnRet, render::RectPrimitive};
|
||||
|
||||
pub struct Image {
|
||||
handle: Option<TextureHandle>,
|
||||
}
|
||||
|
||||
impl<Ctx> Widget<Ctx> for Image {
|
||||
fn draw(&self, painter: &mut crate::Painter<Ctx>) {
|
||||
fn draw(&self, mut painter: Painter<Ctx>) {
|
||||
if let Some(handle) = &self.handle {
|
||||
painter.draw_texture(handle);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user