mirror of
https://github.com/wez/wezterm.git
synced 2024-11-10 15:04:32 +03:00
add Rect::bottom_right
This commit is contained in:
parent
6d902d8a39
commit
896586809f
@ -115,10 +115,7 @@ pub trait BitmapImage {
|
||||
|
||||
/// Draw a 1-pixel wide rectangle
|
||||
fn draw_rect(&mut self, rect: Rect, color: Color, operator: Operator) {
|
||||
let bottom_right = Point {
|
||||
x: rect.top_left.x + rect.width as isize,
|
||||
y: rect.top_left.y + rect.height as isize,
|
||||
};
|
||||
let bottom_right = rect.bottom_right();
|
||||
|
||||
// Draw the vertical lines down either side
|
||||
self.draw_line(
|
||||
|
@ -56,6 +56,16 @@ pub struct Rect {
|
||||
pub height: usize,
|
||||
}
|
||||
|
||||
impl Rect {
|
||||
#[inline]
|
||||
pub fn bottom_right(&self) -> Point {
|
||||
Point {
|
||||
x: self.top_left.x + self.width as isize,
|
||||
y: self.top_left.y + self.height as isize,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait PaintContext {
|
||||
fn get_dimensions(&self) -> Dimensions;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user