better & more fine grained redraw system (should allow movement)
This commit is contained in:
@@ -41,12 +41,10 @@ impl Widget for Text {
|
||||
let (handle, offset) = painter.render_text(&mut self.buf, &self.content, &self.attrs);
|
||||
let dims = handle.size();
|
||||
let size = offset.size(&handle);
|
||||
let mut region = painter.region().center().expand(size);
|
||||
let mut region = Align::Center.pos().expand(size);
|
||||
region.top_left.offset += offset.top_left;
|
||||
region.bot_right.offset = region.top_left.offset + dims;
|
||||
painter.draw_texture_at(&handle, region);
|
||||
// TODO: when on_update is added to painter,
|
||||
// reuse TextureHandle
|
||||
painter.draw_texture_within(&handle, region);
|
||||
}
|
||||
|
||||
fn get_size(&mut self, ctx: &mut SizeCtx) -> Vec2 {
|
||||
|
||||
Reference in New Issue
Block a user