ing prefix gives off bad vibes
This commit is contained in:
16
src/core/position/sized.rs
Normal file
16
src/core/position/sized.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
pub struct Sized {
|
||||
pub inner: WidgetId,
|
||||
pub size: Vec2,
|
||||
}
|
||||
|
||||
impl Widget for Sized {
|
||||
fn draw(&mut self, painter: &mut Painter) {
|
||||
painter.widget(&self.inner);
|
||||
}
|
||||
|
||||
fn desired_size(&mut self, _: &mut SizeCtx) -> UiVec2 {
|
||||
UiVec2::abs(self.size)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user