[librsvg/rustify-rsvg-convert: 27/41] rsvg-convert: error out if either width or height is 0




commit 1d1b605086ca67c1654186f059cdfae35d888863
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Jan 9 16:08:47 2021 +0100

    rsvg-convert: error out if either width or height is 0

 src/bin/rsvg-convert/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/bin/rsvg-convert/main.rs b/src/bin/rsvg-convert/main.rs
index c66e593c..91e9b18a 100644
--- a/src/bin/rsvg-convert/main.rs
+++ b/src/bin/rsvg-convert/main.rs
@@ -47,7 +47,7 @@ enum ResizeStrategy {
 
 impl ResizeStrategy {
     pub fn apply(self, input: Size, keep_aspect_ratio: bool) -> Result<Size, ()> {
-        if input.w == 0.0 && input.h == 0.0 {
+        if input.w == 0.0 || input.h == 0.0 {
             return Err(());
         }
 


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