summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 453ab85)
raw | patch | inline | side by side (parent: 453ab85)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 12 Oct 2007 05:40:24 +0000 (05:40 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 12 Oct 2007 05:40:24 +0000 (05:40 +0000) |
src/gradient-drag.cpp | patch | blob | history | |
src/gradient-drag.h | patch | blob | history |
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 3f7195b070f5f74ab1ab961d8592de61ffc3320e..9244b8fd2aaccf264ea13f84e282ed5d10d0a8ac 100644 (file)
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
int count = 0;
- for (GSList const* i = ((GrDragger*)drag->selected->data)->draggables; i != NULL; i = i->next) { // for all draggables of dragger
- GrDraggable *draggable = (GrDraggable *) i->data;
-
- if (ret == QUERY_STYLE_NOTHING) {
- ret = QUERY_STYLE_SINGLE;
- } else if (ret == QUERY_STYLE_SINGLE) {
- ret = QUERY_STYLE_MULTIPLE_AVERAGED;
- }
+ for (GList *i = drag->selected; i != NULL; i = i->next) { // for all selected draggers
+ GrDragger *d = (GrDragger *) i->data;
+ for (GSList const* j = d->draggables; j != NULL; j = j->next) { // for all draggables of dragger
+ GrDraggable *draggable = (GrDraggable *) j->data;
+
+ if (ret == QUERY_STYLE_NOTHING) {
+ ret = QUERY_STYLE_SINGLE;
+ } else if (ret == QUERY_STYLE_SINGLE) {
+ ret = QUERY_STYLE_MULTIPLE_AVERAGED;
+ }
- guint32 c = sp_item_gradient_stop_query_style (draggable->item, draggable->point_type, draggable->point_i, draggable->fill_or_stroke);
- cf[0] += SP_RGBA32_R_F (c);
- cf[1] += SP_RGBA32_G_F (c);
- cf[2] += SP_RGBA32_B_F (c);
- cf[3] += SP_RGBA32_A_F (c);
+ guint32 c = sp_item_gradient_stop_query_style (draggable->item, draggable->point_type, draggable->point_i, draggable->fill_or_stroke);
+ cf[0] += SP_RGBA32_R_F (c);
+ cf[1] += SP_RGBA32_G_F (c);
+ cf[2] += SP_RGBA32_B_F (c);
+ cf[3] += SP_RGBA32_A_F (c);
- count ++;
+ count ++;
+ }
}
if (count) {
/**
Select the knot next to the last selected one and deselect all other selected.
*/
-void
+GrDragger *
GrDrag::select_next ()
{
+ GrDragger *d = NULL;
if (selected == NULL || g_list_find(draggers, selected->data)->next == NULL) {
- if (draggers)
- setSelected ((GrDragger *) draggers->data);
+ if (draggers)
+ d = (GrDragger *) draggers->data;
} else {
- setSelected ((GrDragger *) g_list_find(draggers, selected->data)->next->data);
+ d = (GrDragger *) g_list_find(draggers, selected->data)->next->data;
}
+ if (d)
+ setSelected (d);
+ return d;
}
/**
Select the knot previous from the last selected one and deselect all other selected.
*/
-void
+GrDragger *
GrDrag::select_prev ()
{
+ GrDragger *d = NULL;
if (selected == NULL || g_list_find(draggers, selected->data)->prev == NULL) {
if (draggers)
- setSelected ((GrDragger *) g_list_last (draggers)->data);
+ d = (GrDragger *) g_list_last (draggers)->data;
} else {
- setSelected ((GrDragger *) g_list_find(draggers, selected->data)->prev->data);
+ d = (GrDragger *) g_list_find(draggers, selected->data)->prev->data;
}
+ if (d)
+ setSelected (d);
+ return d;
}
diff --git a/src/gradient-drag.h b/src/gradient-drag.h
index a7b5af36b64af88e626a147eff05d15940d4fecc..b9a2fdcc22aa66204818e697958b588079427589 100644 (file)
--- a/src/gradient-drag.h
+++ b/src/gradient-drag.h
void selected_move (double x, double y, bool write_repr = true, bool scale_radial = false);
void selected_move_screen (double x, double y);
- void select_next ();
- void select_prev ();
+ GrDragger *select_next ();
+ GrDragger *select_prev ();
void selected_reverse_vector ();