Skip to content

Commit f875205

Browse files
newinnovationsginnyTheCat
authored andcommitted
Added translate() operations
1 parent 3d25fbe commit f875205

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rect.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ impl IRect {
8686
pub fn intersect(&self, rect: &Self) -> Self {
8787
unsafe { fz_intersect_irect((*self).into(), (*rect).into()) }.into()
8888
}
89+
90+
pub fn translate(&self, xoff: i32, yoff: i32) -> Self {
91+
unsafe { fz_translate_irect((*self).into(), xoff, yoff) }.into()
92+
}
8993
}
9094

9195
impl fmt::Display for IRect {
@@ -203,6 +207,10 @@ impl Rect {
203207
pub fn intersect(&self, rect: &Self) -> Self {
204208
unsafe { fz_intersect_rect((*self).into(), (*rect).into()) }.into()
205209
}
210+
211+
pub fn translate(&self, xoff: f32, yoff: f32) -> Self {
212+
unsafe { fz_translate_rect((*self).into(), xoff, yoff) }.into()
213+
}
206214
}
207215

208216
impl fmt::Display for Rect {

0 commit comments

Comments
 (0)