[gimp] app: allow 0.0 precision for gimp_coords_interpolate_bezier().



commit e813d90fbbbb3b0292ff78840b185cc1298abb20
Author: Jehan <jehan girinstud io>
Date:   Wed Jan 20 20:14:06 2021 +0100

    app: allow 0.0 precision for gimp_coords_interpolate_bezier().
    
    All it will mean is that we are looking for perfectly straight lines
    when deciding if a bezier curve can be considered straight. It's a fair
    condition and represents perfectly what a precision of 0.0 would mean.

 app/core/gimpcoords-interpolate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpcoords-interpolate.c b/app/core/gimpcoords-interpolate.c
index f667e57de9..8cc232ecf3 100644
--- a/app/core/gimpcoords-interpolate.c
+++ b/app/core/gimpcoords-interpolate.c
@@ -52,7 +52,7 @@ gimp_coords_interpolate_bezier (const GimpCoords  bezier_pt[4],
                                 GArray           *ret_params)
 {
   g_return_if_fail (bezier_pt != NULL);
-  g_return_if_fail (precision > 0.0);
+  g_return_if_fail (precision >= 0.0);
   g_return_if_fail (ret_coords != NULL);
 
   gimp_coords_interpolate_bezier_internal (bezier_pt,
@@ -217,7 +217,7 @@ gimp_coords_bezier_is_straight (const GimpCoords bezier_pt[4],
   GimpCoords pt1, pt2;
 
   g_return_val_if_fail (bezier_pt != NULL, FALSE);
-  g_return_val_if_fail (precision > 0.0, FALSE);
+  g_return_val_if_fail (precision >= 0.0, FALSE);
 
   /* calculate the "ideal" positions for the control points */
 


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