Skip to content

Commit

Permalink
[agx] Add Rect.add_origin
Browse files Browse the repository at this point in the history
  • Loading branch information
codyd51 committed Dec 26, 2022
1 parent 4aee9c3 commit 46dc460
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rust_programs/agx_definitions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ impl Rect {
Self::from_parts(self.origin, new_size)
}

pub fn add_origin(&self, addend: Point) -> Self {
Self::from_parts(self.origin + addend, self.size)
}

pub fn from_parts(origin: Point, size: Size) -> Self {
Rect { origin, size }
}
Expand Down

0 comments on commit 46dc460

Please sign in to comment.