summaryrefslogtreecommitdiffstats
path: root/src/gradient-chemistry.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-07-24 19:53:33 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-07-24 19:53:33 +0000
commit5a37f06c70e0e4e2519812564f4dcdced7c0246a (patch)
treef959f73813cb6f968072aee1100323b24e294136 /src/gradient-chemistry.cpp
parentupdate to trunk (diff)
parentFix a bug continuing a bezier path whith a LPE one like spiro or bspline on a... (diff)
downloadinkscape-5a37f06c70e0e4e2519812564f4dcdced7c0246a.tar.gz
inkscape-5a37f06c70e0e4e2519812564f4dcdced7c0246a.zip
update to trunk
(bzr r13879.1.17)
Diffstat (limited to 'src/gradient-chemistry.cpp')
-rw-r--r--src/gradient-chemistry.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index aecf1aa35..409e9f0e6 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -1068,7 +1068,7 @@ void sp_item_gradient_set_coords(SPItem *item, GrPointType point_type, guint poi
// using X-coordinates only to determine the offset, assuming p has been snapped to the vector from begin to end.
Geom::Point begin(lg->x1.computed, lg->y1.computed);
Geom::Point end(lg->x2.computed, lg->y2.computed);
- double offset = Geom::LineSegment(begin, end).nearestPoint(p);
+ double offset = Geom::LineSegment(begin, end).nearestTime(p);
SPGradient *vector = sp_gradient_get_forked_vector_if_necessary (lg, false);
lg->ensureVector();
lg->vector.stops.at(point_i).offset = offset;
@@ -1163,7 +1163,7 @@ void sp_item_gradient_set_coords(SPItem *item, GrPointType point_type, guint poi
{
Geom::Point start = Geom::Point (rg->cx.computed, rg->cy.computed);
Geom::Point end = Geom::Point (rg->cx.computed + rg->r.computed, rg->cy.computed);
- double offset = Geom::LineSegment(start, end).nearestPoint(p);
+ double offset = Geom::LineSegment(start, end).nearestTime(p);
SPGradient *vector = sp_gradient_get_forked_vector_if_necessary (rg, false);
rg->ensureVector();
rg->vector.stops.at(point_i).offset = offset;
@@ -1180,7 +1180,7 @@ void sp_item_gradient_set_coords(SPItem *item, GrPointType point_type, guint poi
{
Geom::Point start = Geom::Point (rg->cx.computed, rg->cy.computed);
Geom::Point end = Geom::Point (rg->cx.computed, rg->cy.computed - rg->r.computed);
- double offset = Geom::LineSegment(start, end).nearestPoint(p);
+ double offset = Geom::LineSegment(start, end).nearestTime(p);
SPGradient *vector = sp_gradient_get_forked_vector_if_necessary(rg, false);
rg->ensureVector();
rg->vector.stops.at(point_i).offset = offset;
@@ -1570,8 +1570,9 @@ void sp_gradient_invert_selected_gradients(SPDesktop *desktop, Inkscape::PaintTa
{
Inkscape::Selection *selection = desktop->getSelection();
- for (GSList const* i = selection->itemList(); i != NULL; i = i->next) {
- sp_item_gradient_invert_vector_color(SP_ITEM(i->data), fill_or_stroke);
+ const std::vector<SPItem*> list=selection->itemList();
+ for (std::vector<SPItem*>::const_iterator i = list.begin(); i != list.end(); i++) {
+ sp_item_gradient_invert_vector_color(*i, fill_or_stroke);
}
// we did an undoable action
@@ -1594,9 +1595,10 @@ void sp_gradient_reverse_selected_gradients(SPDesktop *desktop)
if (drag && drag->selected) {
drag->selected_reverse_vector();
} else { // If no drag or no dragger selected, act on selection (both fill and stroke gradients)
- for (GSList const* i = selection->itemList(); i != NULL; i = i->next) {
- sp_item_gradient_reverse_vector(SP_ITEM(i->data), Inkscape::FOR_FILL);
- sp_item_gradient_reverse_vector(SP_ITEM(i->data), Inkscape::FOR_STROKE);
+ const std::vector<SPItem*> list=selection->itemList();
+ for (std::vector<SPItem*>::const_iterator i = list.begin(); i != list.end(); i++) {
+ sp_item_gradient_reverse_vector(*i, Inkscape::FOR_FILL);
+ sp_item_gradient_reverse_vector(*i, Inkscape::FOR_STROKE);
}
}