summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-09-07 08:06:55 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-09-07 08:06:55 +0000
commit0930fd55d812b634da69eba0fe92b4094c554fa0 (patch)
treecd256b99a5eb15014727af17923099ce9d4d463a
parentFix for 580160 : Deleting a gradient stop using Shape tools deletes the object (diff)
downloadinkscape-0930fd55d812b634da69eba0fe92b4094c554fa0.tar.gz
inkscape-0930fd55d812b634da69eba0fe92b4094c554fa0.zip
Fix for 1046868 : Gradient tool (trunk): stop selector cannot access stroke gradient stops of objects with two gradients
(bzr r11656)
-rw-r--r--src/gradient-drag.cpp6
-rw-r--r--src/gradient-drag.h2
-rw-r--r--src/widgets/gradient-toolbar.cpp18
3 files changed, 6 insertions, 20 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index fd5ad159f..c72e47350 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -1759,7 +1759,7 @@ void GrDrag::selectByCoords(std::vector<Geom::Point> coords)
/**
* Select draggers by stop
*/
-void GrDrag::selectByStop(SPStop *stop )
+void GrDrag::selectByStop(SPStop *stop, bool add_to_selection, bool override )
{
for (GList *i = this->draggers; i != NULL; i = i->next) {
@@ -1768,11 +1768,11 @@ void GrDrag::selectByStop(SPStop *stop )
GrDraggable *d = (GrDraggable *) j->data;
SPGradient *gradient = getGradient(d->item, d->fill_or_stroke);
- SPGradient *vector = sp_gradient_get_forked_vector_if_necessary(gradient, false);
+ SPGradient *vector = gradient->getVector(false);
SPStop *stop_i = sp_get_stop_i(vector, d->point_i);
if (stop_i == stop) {
- setSelected(dragger, true, true);
+ setSelected(dragger, add_to_selection, override);
}
}
}
diff --git a/src/gradient-drag.h b/src/gradient-drag.h
index 7fb5c5de2..4bab3aeb2 100644
--- a/src/gradient-drag.h
+++ b/src/gradient-drag.h
@@ -144,7 +144,7 @@ public: // FIXME: make more of this private!
void deselectAll();
void selectAll();
void selectByCoords(std::vector<Geom::Point> coords);
- void selectByStop(SPStop *stop);
+ void selectByStop(SPStop *stop, bool add_to_selection = true, bool override = true);
void selectRect(Geom::Rect const &r);
bool dropColor(SPItem *item, gchar const *c, Geom::Point p);
diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp
index 295f211b0..ae85ed515 100644
--- a/src/widgets/gradient-toolbar.cpp
+++ b/src/widgets/gradient-toolbar.cpp
@@ -671,22 +671,8 @@ static void select_drag_by_stop( GtkWidget *data, SPGradient *gradient, SPEventC
SPStop *stop = get_selected_stop(data);
-
- SPStop *stop_iter;
- GList *i;
-
- // Walk thru the draggers and the gradient stops at the same time
- for (i = drag->draggers, stop_iter = gradient->getFirstStop();
- i != NULL && stop_iter && SP_IS_STOP(stop_iter);
- i = i->next, stop_iter = SP_STOP(stop_iter->getNext())) {
-
- if (stop == stop_iter) {
- GrDragger *d = (GrDragger *) i->data;
- drag->setSelected(d, false, true);
- blocked = FALSE;
- return;
- }
- }
+ drag->selectByStop(stop, false, true);
+ blocked = FALSE;
}
static void select_stop_by_drag(GtkWidget *combo_box, SPGradient *gradient, SPEventContext *ev, GtkWidget *data)