diff options
Diffstat (limited to 'components/canvas/canvas_data.rs')
-rw-r--r-- | components/canvas/canvas_data.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index d4a3bcc9a1a..0ce0b352ccc 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -590,6 +590,9 @@ fn crop_image( // We're going to iterate over a pixel values array so we need integers let crop_rect = crop_rect.to_i32(); let image_size = image_size.to_i32(); + if crop_rect == Rect::from_size(image_size) { + return image_data; + } // Assuming 4 bytes per pixel and row-major order for storage // (consecutive elements in a pixel row of the image are contiguous in memory) let stride = image_size.width * 4; |