[gimp] app: Make catmul-rom coords intepolation clamp pressure



commit 15081a3a738e94cb70d045c360c94a8ad007ec18
Author: Alexia Death <alexiadeath gmail com>
Date:   Wed Feb 24 02:06:15 2010 +0200

    app: Make catmul-rom coords intepolation clamp pressure

 app/core/gimpcoords-interpolate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimpcoords-interpolate.c b/app/core/gimpcoords-interpolate.c
index 3b6575a..72de318 100644
--- a/app/core/gimpcoords-interpolate.c
+++ b/app/core/gimpcoords-interpolate.c
@@ -267,6 +267,7 @@ gimp_coords_interpolate_catmull (const GimpCoords   catmul_pt1,
     {
       GimpCoords coords;
       gdouble    velocity;
+      gdouble    pressure;
       gdouble    p = (gdouble) n / num_points;
 
       coords.x =
@@ -283,12 +284,13 @@ gimp_coords_interpolate_catmull (const GimpCoords   catmul_pt1,
                                               end_coords.y,
                                               future_coords.y);
 
-      coords.pressure =
+      pressure =
         gimp_coords_get_catmull_spline_point (p,
                                               past_coords.pressure,
                                               start_coords.pressure,
                                               end_coords.pressure,
                                               future_coords.pressure);
+      coords.pressure = CLAMP (pressure, 0.0, 1.0);
 
       coords.xtilt =
         gimp_coords_get_catmull_spline_point (p,



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