diff --git a/lib/svg_sigs.mli b/lib/svg_sigs.mli index 949ca3b07..ebd6dd1a2 100644 --- a/lib/svg_sigs.mli +++ b/lib/svg_sigs.mli @@ -1116,6 +1116,8 @@ module type Wrapped_functions = sig val string_of_orient : (Svg_types.Unit.angle option, string) Xml.W.ft val string_of_paint : ([< Svg_types.paint], string) Xml.W.ft + + val string_of_opacity : (float, string) Xml.W.ft val string_of_fill_rule : ([< Svg_types.fill_rule], string) Xml.W.ft diff --git a/syntax/attribute_value.ml b/syntax/attribute_value.ml index 0482eb17b..43c815397 100644 --- a/syntax/attribute_value.ml +++ b/syntax/attribute_value.ml @@ -501,12 +501,12 @@ let fill_opacity = in let v = - if group_matched 2 s then [%expr [%e n] /. 100.] - else [%expr [%e n]] in + if group_matched 2 s then (n /. 100.) + else n in - if v >= 0. && v <= 1. then Some v + if v >= 0. && v <= 1. then Some [%expr [%e v]] else - Common.error loc "Value of %s must be between 0 and 1." name in + Common.error loc "Value of %s must be between 0 and 1." name end [@metaloc loc] let fill_rule ?separated_by:_ ?default:_ loc _name s =