Skip to content

Commit

Permalink
Deprecate GenericImageView::bounds (#2036)
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia authored Oct 22, 2023
1 parent b7ba5dd commit 0253997
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,10 +960,12 @@ pub trait GenericImageView {
}

/// The bounding rectangle of this image.
#[deprecated = "This method has inconsistent behavior between implementations (#1829). Use `dimensions` instead"]
fn bounds(&self) -> (u32, u32, u32, u32);

/// Returns true if this x, y coordinate is contained inside the image.
fn in_bounds(&self, x: u32, y: u32) -> bool {
#[allow(deprecated)]
let (ix, iy, iw, ih) = self.bounds();
x >= ix && x < ix + iw && y >= iy && y < iy + ih
}
Expand Down

0 comments on commit 0253997

Please sign in to comment.