[librsvg: 2/10] surface_utils: use IRect::contains



commit e6038510a844d3eb7fd99a41188133410349f97b
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Nov 24 11:13:36 2019 +0100

    surface_utils: use IRect::contains

 rsvg_internals/src/surface_utils/iterators.rs | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/surface_utils/iterators.rs b/rsvg_internals/src/surface_utils/iterators.rs
index 29ec0e51..72de12de 100644
--- a/rsvg_internals/src/surface_utils/iterators.rs
+++ b/rsvg_internals/src/surface_utils/iterators.rs
@@ -131,11 +131,7 @@ impl<'a> Iterator for PixelRectangle<'a> {
 
         let rv = {
             let get_pixel = |x, y| {
-                if x < self.bounds.x0
-                    || y < self.bounds.y0
-                    || x >= self.bounds.x1
-                    || y >= self.bounds.y1
-                {
+                if !self.bounds.contains(x, y) {
                     match self.edge_mode {
                         EdgeMode::None => Pixel {
                             r: 0,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]