summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 29b75b6)
raw | patch | inline | side by side (parent: 29b75b6)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 3 Feb 2007 22:45:47 +0000 (22:45 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 3 Feb 2007 22:45:47 +0000 (22:45 +0000) |
src/gradient-chemistry.cpp | patch | blob | history | |
src/gradient-chemistry.h | patch | blob | history | |
src/gradient-drag.cpp | patch | blob | history |
index bacdfb6aac405cbdc8fc808c10a2b975ebe25132..78ea135076387886839cdaaea2c3a9f2f54e430d 100644 (file)
@@ -624,13 +624,11 @@ sp_item_gradient_stop_set_style (SPItem *item, guint point_type, guint point_i,
if (!vector) // orphan!
return;
-
- /*
- vector = sp_gradient_fork_vector_if_necessary (vector); // TESTJOHAN
+
+ vector = sp_gradient_fork_vector_if_necessary (vector);
if ( gradient != vector && gradient->ref->getObject() != vector ) {
sp_gradient_repr_set_link(SP_OBJECT_REPR(gradient), vector);
}
- */
switch (point_type) {
case POINT_LG_BEGIN:
@@ -1226,6 +1224,18 @@ sp_gradient_vector_for_object(SPDocument *const doc, SPDesktop *const desktop,
return sp_document_default_gradient_vector(doc, rgba);
}
+
+SPGradient *
+sp_gradient_get_forked_vector_if_necessary(SPGradient *gradient, bool force_vector)
+{
+ SPGradient *vector = sp_gradient_get_vector (gradient, force_vector);
+ vector = sp_gradient_fork_vector_if_necessary (vector);
+ if ( gradient != vector && gradient->ref->getObject() != vector ) {
+ sp_gradient_repr_set_link(SP_OBJECT_REPR(gradient), vector);
+ }
+ return vector;
+}
+
/*
Local Variables:
mode:c++
index 4ddae86ce41b5559db6ea1c3e870245972baad37..e4fbb79d94968fd32a059a7d5ef486e243443f26 100644 (file)
--- a/src/gradient-chemistry.h
+++ b/src/gradient-chemistry.h
SPGradient *sp_gradient_reset_to_userspace (SPGradient *gr, SPItem *item);
SPGradient *sp_gradient_fork_vector_if_necessary (SPGradient *gr);
+SPGradient *sp_gradient_get_forked_vector_if_necessary(SPGradient *gradient, bool force_vector);
+
SPStop* sp_first_stop(SPGradient *gradient);
SPStop* sp_last_stop(SPGradient *gradient);
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 74fc2fe67c6317cc4e5e484421d4957600edc455..c02190df8ea12c41cba8a14820e16e07922d96b1 100644 (file)
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
for (GSList * drgble = dragger->draggables; drgble != NULL; drgble = drgble->next) {
GrDraggable *draggable = (GrDraggable*) drgble->data;
SPGradient *gradient = sp_item_gradient (draggable->item, draggable->fill_or_stroke);
- SPGradient *vector = sp_gradient_get_vector (gradient, false);
+ SPGradient *vector = sp_gradient_get_forked_vector_if_necessary (gradient, false);
+
switch (draggable->point_type) {
case POINT_LG_MID:
case POINT_RG_MID1: