FINALLY FIXED STUPID TEST UI ISSUES (true painter.rs moment) + scrolling
This commit is contained in:
@@ -3,7 +3,7 @@ use image::DynamicImage;
|
||||
use crate::{
|
||||
core::{TextEdit, TextEditCtx},
|
||||
layout::{
|
||||
IdLike, PainterCtx, PainterData, PixelRegion, StaticWidgetId, TextureHandle, Vec2, Widget,
|
||||
IdLike, PainterData, PixelRegion, StaticWidgetId, TextureHandle, Vec2, Widget,
|
||||
WidgetId, WidgetInstance, WidgetLike,
|
||||
},
|
||||
util::{HashSet, Id},
|
||||
@@ -109,9 +109,8 @@ impl Ui {
|
||||
}
|
||||
// free before bc nothing should exist
|
||||
self.free();
|
||||
let mut ctx = PainterCtx::new(&mut self.data);
|
||||
if let Some(root) = &self.root {
|
||||
ctx.draw(root.id);
|
||||
self.data.draw(root.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,13 +137,7 @@ impl Ui {
|
||||
}
|
||||
|
||||
fn redraw_updates(&mut self) {
|
||||
// if self.updates.drain(..).next().is_some() {
|
||||
// self.redraw_all();
|
||||
// }
|
||||
let mut ctx = PainterCtx::new(&mut self.data);
|
||||
for id in self.updates.drain() {
|
||||
ctx.redraw(id);
|
||||
}
|
||||
self.data.redraw(std::mem::take(&mut self.updates));
|
||||
self.free();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user