the great orientation refactor (move to x & y UiScalars/Spans) + don't call full size in align
This commit is contained in:
@@ -100,11 +100,13 @@ impl Widget for Text {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn text_region(tex: &TextTexture, align: Align) -> UiRegion {
|
||||
pub fn text_region(tex: &TextTexture, align: RegionAlign) -> UiRegion {
|
||||
let tex_dims = tex.handle.size();
|
||||
let mut region = UiRegion::from_size_align(tex.size(), align);
|
||||
region.top_left.abs += tex.top_left;
|
||||
region.bot_right.abs = region.top_left.abs + tex_dims;
|
||||
let mut region = tex.size().align(align);
|
||||
region.x.start.abs += tex.top_left.x;
|
||||
region.y.start.abs += tex.top_left.y;
|
||||
region.x.end.abs = region.x.start.abs + tex_dims.x;
|
||||
region.y.end.abs = region.y.start.abs + tex_dims.y;
|
||||
region
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user