summaryrefslogtreecommitdiffstats
path: root/src/widgets/gradient-toolbar.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-01-17 08:28:11 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-01-17 08:28:11 +0000
commitf330d4c03f724554e7106b1b3437f1c9699eb675 (patch)
tree6a3f6d2e6a9b7867ff85e8ff8b0db95f2b7ef0cd /src/widgets/gradient-toolbar.cpp
parentremove references to about.bg.svg (diff)
downloadinkscape-f330d4c03f724554e7106b1b3437f1c9699eb675.tar.gz
inkscape-f330d4c03f724554e7106b1b3437f1c9699eb675.zip
Upgraded gradient tool =)
(bzr r2228)
Diffstat (limited to 'src/widgets/gradient-toolbar.cpp')
-rw-r--r--src/widgets/gradient-toolbar.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp
index d0034611f..9dd43fb31 100644
--- a/src/widgets/gradient-toolbar.cpp
+++ b/src/widgets/gradient-toolbar.cpp
@@ -114,9 +114,12 @@ gr_apply_gradient (Inkscape::Selection *selection, GrDrag *drag, SPGradient *gr)
SPGradientType new_type = (SPGradientType) prefs_get_int_attribute ("tools.gradient", "newgradient", SP_GRADIENT_TYPE_LINEAR);
guint new_fill = prefs_get_int_attribute ("tools.gradient", "newfillorstroke", 1);
+
+ // GRADIENTFIXME: make this work for multiple selected draggers.
+
// First try selected dragger
if (drag && drag->selected) {
- GrDragger *dragger = drag->selected;
+ GrDragger *dragger = (GrDragger*) drag->selected->data;
for (GSList const* i = dragger->draggables; i != NULL; i = i->next) { // for all draggables of dragger
GrDraggable *draggable = (GrDraggable *) i->data;
gr_apply_gradient_to_item (draggable->item, gr, new_type, new_fill, draggable->fill_or_stroke, !draggable->fill_or_stroke);
@@ -126,7 +129,7 @@ gr_apply_gradient (Inkscape::Selection *selection, GrDrag *drag, SPGradient *gr)
// If no drag or no dragger selected, act on selection
for (GSList const* i = selection->itemList(); i != NULL; i = i->next) {
- gr_apply_gradient_to_item (SP_ITEM(i->data), gr, new_type, new_fill, true, true);
+ gr_apply_gradient_to_item (SP_ITEM(i->data), gr, new_type, new_fill, new_fill, !new_fill);
}
}
@@ -263,7 +266,8 @@ void
gr_read_selection (Inkscape::Selection *selection, GrDrag *drag, SPGradient **gr_selected, bool *gr_multi, SPGradientSpread *spr_selected, bool *spr_multi)
{
if (drag && drag->selected) {
- GrDragger *dragger = drag->selected;
+ // GRADIENTFIXME: make this work for more than one selected dragger?
+ GrDragger *dragger = (GrDragger*) drag->selected->data;
for (GSList const* i = dragger->draggables; i != NULL; i = i->next) { // for all draggables of dragger
GrDraggable *draggable = (GrDraggable *) i->data;
SPGradient *gradient = sp_item_gradient_get_vector (draggable->item, draggable->fill_or_stroke);