[librsvg: 1/30] color_matrix: parse saturate as f64




commit 6fd3c7b8adfc671514f2d48e5b817e58cb7ff831
Author: Paolo Borelli <pborelli gnome org>
Date:   Wed Dec 23 17:52:41 2020 +0100

    color_matrix: parse saturate as f64
    
    In svg2 values outside the 0..1 range under- or oversaturates the filter
    input image respectively.

 src/filters/color_matrix.rs | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/src/filters/color_matrix.rs b/src/filters/color_matrix.rs
index c9d82d36..c95aa7ec 100644
--- a/src/filters/color_matrix.rs
+++ b/src/filters/color_matrix.rs
@@ -93,13 +93,7 @@ impl SetAttributes for FeColorMatrix {
                         matrix
                     }
                     OperationType::Saturate => {
-                        let s: f64 = attr.parse_and_validate(value, |s| {
-                            if s < 0.0 || s > 1.0 {
-                                Err(ValueErrorKind::value_error("expected value from 0 to 1"))
-                            } else {
-                                Ok(s)
-                            }
-                        })?;
+                        let s: f64 = attr.parse(value)?;
 
                         Matrix5::new(
                             0.213 + 0.787 * s, 0.715 - 0.715 * s, 0.072 - 0.072 * s, 0.0, 0.0,


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