From 56693a8393245f1c0fe40d9ad7dc5bf519dce019 Mon Sep 17 00:00:00 2001 From: Ell Date: Tue, 14 Apr 2020 17:50:54 +0300 Subject: [PATCH] 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;