[gimp] app: when copying GimpCurve, don't overwrite points from samples



commit 56693a8393245f1c0fe40d9ad7dc5bf519dce019
Author: Ell <ell_se yahoo com>
Date:   Tue Apr 14 17:50:54 2020 +0300

    app: when copying GimpCurve, don't overwrite points from samples
    
    In gimp_curve_config_copy(), make sure to copy the curve type
    *before* the points, so that, when changing the type from FREE to
    SMOOTH, we don't overwrite the copied points with interpolated
    samples.

 app/core/gimpcurve.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/app/core/gimpcurve.c b/app/core/gimpcurve.c
index 31b357b435..64db90ace4 100644
--- a/app/core/gimpcurve.c
+++ b/app/core/gimpcurve.c
@@ -626,6 +626,11 @@ gimp_curve_config_copy (GimpConfig  *src,
   GimpCurve *src_curve  = GIMP_CURVE (src);
   GimpCurve *dest_curve = GIMP_CURVE (dest);
 
+  /* make sure the curve type is copied *before* the points, so that we don't
+   * overwrite the copied points when changing the type
+   */
+  dest_curve->curve_type = src_curve->curve_type;
+
   gimp_config_sync (G_OBJECT (src), G_OBJECT (dest), flags);
 
   dest_curve->identity = src_curve->identity;


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