fix mask render bug (didn't recreate bind group)
This commit is contained in:
@@ -80,10 +80,24 @@ impl TextView {
|
||||
self.tex.as_ref()
|
||||
}
|
||||
pub fn desired_width(&mut self, ctx: &mut SizeCtx) -> Len {
|
||||
Len::abs(self.render(ctx).size.x)
|
||||
if let Some(hint) = &self.hint
|
||||
&& let [line] = &self.buf.lines[..]
|
||||
&& line.text().is_empty()
|
||||
{
|
||||
ctx.width(hint)
|
||||
} else {
|
||||
Len::abs(self.render(ctx).size.x)
|
||||
}
|
||||
}
|
||||
pub fn desired_height(&mut self, ctx: &mut SizeCtx) -> Len {
|
||||
Len::abs(self.render(ctx).size.y)
|
||||
if let Some(hint) = &self.hint
|
||||
&& let [line] = &self.buf.lines[..]
|
||||
&& line.text().is_empty()
|
||||
{
|
||||
ctx.height(hint)
|
||||
} else {
|
||||
Len::abs(self.render(ctx).size.y)
|
||||
}
|
||||
}
|
||||
pub fn draw(&mut self, painter: &mut Painter) -> UiRegion {
|
||||
let tex = self.render(&mut painter.size_ctx());
|
||||
|
||||
Reference in New Issue
Block a user