From 56e9e206a6ff617da7119c9ba1804df8ace35243 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sun, 25 Mar 2007 02:01:37 +0000 Subject: [PATCH] fix live dragging of gradient midstops, and fix crash when dragging writes to repr --- src/gradient-chemistry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index 0a312193d..5ed49b2ab 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -799,6 +799,7 @@ sp_item_gradient_set_coords (SPItem *item, guint point_type, guint point_i, NR:: case POINT_LG_MID: { // using X-coordinates only to determine the offset, assuming p has been snapped to the vector from begin to end. + sp_gradient_ensure_vector(gradient); double offset = get_offset_between_points (p, NR::Point(lg->x1.computed, lg->y1.computed), NR::Point(lg->x2.computed, lg->y2.computed)); SPGradient *vector = sp_gradient_get_vector (lg, false); lg->vector.stops.at(point_i).offset = offset; @@ -807,7 +808,7 @@ sp_item_gradient_set_coords (SPItem *item, guint point_type, guint point_i, NR:: if (write_repr) { sp_repr_set_css_double(SP_OBJECT_REPR(stopi), "offset", stopi->offset); } else { - SP_OBJECT (gradient)->requestModified(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); + SP_OBJECT (stopi)->requestModified(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } } break; -- 2.30.2