store size in tex instead of bot_right
This commit is contained in:
@@ -157,8 +157,8 @@ impl TextData {
|
||||
}
|
||||
TextTexture {
|
||||
handle: textures.add(image),
|
||||
top_left: Vec2::new(min_x as f32, min_y as f32),
|
||||
bot_right: Vec2::new(max_width - max_x as f32, height - max_y as f32),
|
||||
top_left_offset: Vec2::new(min_x as f32, min_y as f32),
|
||||
size: Vec2::new(max_width, height),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,12 +166,7 @@ impl TextData {
|
||||
#[derive(Clone)]
|
||||
pub struct TextTexture {
|
||||
pub handle: TextureHandle,
|
||||
pub top_left: Vec2,
|
||||
pub bot_right: Vec2,
|
||||
pub top_left_offset: Vec2,
|
||||
pub size: Vec2,
|
||||
}
|
||||
|
||||
impl TextTexture {
|
||||
pub fn size(&self) -> Vec2 {
|
||||
self.handle.size() - self.top_left + self.bot_right
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user