summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b98e9f3)
raw | patch | inline | side by side (parent: b98e9f3)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 12 Oct 2007 05:41:16 +0000 (05:41 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 12 Oct 2007 05:41:16 +0000 (05:41 +0000) |
src/gradient-context.cpp | patch | blob | history |
index 93cf792141544419e5cffc128b3669b75e65c4eb..e8a280c408d7dec8285a4ea8f5bdb88e9800d151 100644 (file)
--- a/src/gradient-context.cpp
+++ b/src/gradient-context.cpp
GrDrag *drag = event_context->_grdrag;
g_assert (drag);
- drag->select_next();
+ GrDragger *d = drag->select_next();
+
+ event_context->desktop->scroll_to_point(&(d->point), 1.0);
}
void
GrDrag *drag = event_context->_grdrag;
g_assert (drag);
- drag->select_prev();
+ GrDragger *d = drag->select_prev();
+
+ event_context->desktop->scroll_to_point(&(d->point), 1.0);
}
// FIXME: make global function in libnr or somewhere.
std::vector<NR::Point> coords = sp_gradient_context_get_stop_intervals (drag, &these_stops, &next_stops);
+ if (g_slist_length(these_stops) == 0 && drag->numSelected() == 1) {
+ // if a single stop is selected, add between that stop and the next one
+ GrDragger *dragger = (GrDragger *) drag->selected->data;
+ for (GSList const* j = dragger->draggables; j != NULL; j = j->next) {
+ GrDraggable *d = (GrDraggable *) j->data;
+ SPGradient *gradient = sp_item_gradient (d->item, d->fill_or_stroke);
+ SPGradient *vector = sp_gradient_get_forked_vector_if_necessary (gradient, false);
+ SPStop *this_stop = sp_get_stop_i (vector, d->point_i);
+ SPStop *next_stop = sp_next_stop (this_stop);
+ if (this_stop && next_stop) {
+ these_stops = g_slist_prepend (these_stops, this_stop);
+ next_stops = g_slist_prepend (next_stops, next_stop);
+ }
+ }
+ }
+
// now actually create the new stops
GSList *i = these_stops;
GSList *j = next_stops;