From 7e8ffe9fb3b42470802ed080dc827fdda32165b3 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 27 Jun 2010 20:16:09 -0700 Subject: Partial C++-ification of SPGradient (bzr r9542) --- src/gradient-drag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gradient-drag.cpp') diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 11de93d68..227a5f003 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -348,7 +348,7 @@ GrDrag::addStopNearPoint (SPItem *item, Geom::Point mouse_p, double tolerance) SPStop *newstop = sp_vector_add_stop (vector, prev_stop, next_stop, offset); - sp_gradient_ensure_vector (gradient); + gradient->ensureVector(); updateDraggers(); return newstop; -- cgit v1.2.3 From 4bee400f3d7b314c3930b450e6715dfe48a33412 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 1 Jul 2010 23:21:58 +0200 Subject: fix Launchpad bug 593023: crash in constrained snap due to not calling setup() before snapping Fixed bugs: - https://launchpad.net/bugs/593023 (bzr r9550) --- src/gradient-drag.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gradient-drag.cpp') diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 227a5f003..c9a982e42 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -809,9 +809,10 @@ gr_knot_moved_midpoint_handler(SPKnot */*knot*/, Geom::Point const &ppointer, gu } else { p = snap_vector_midpoint (p, low_lim, high_lim, 0); if (!(state & GDK_SHIFT_MASK)) { + Inkscape::Snapper::ConstraintLine cl(low_lim, high_lim - low_lim); SPDesktop *desktop = dragger->parent->desktop; SnapManager &m = desktop->namedview->snap_manager; - Inkscape::Snapper::ConstraintLine cl(low_lim, high_lim - low_lim); + m.setup(desktop); m.constrainedSnapReturnByRef(p, Inkscape::SNAPSOURCE_OTHER_HANDLE, cl); } } -- cgit v1.2.3 From 0f742a4711da57918b22c2d193cf97aa60db010d Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 3 Jul 2010 15:58:53 -0700 Subject: Suppress gradient handles when editing objects with solid fills. (bzr r9562) --- src/gradient-drag.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'src/gradient-drag.cpp') diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index c9a982e42..55348616e 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -1624,41 +1624,43 @@ GrDrag::grabKnot (SPItem *item, gint point_type, gint point_i, bool fill_or_stro Regenerates the draggers list from the current selection; is called when selection is changed or modified, also when a radial dragger needs to update positions of other draggers in the gradient */ -void -GrDrag::updateDraggers () +void GrDrag::updateDraggers () { while (selected) { selected = g_list_remove(selected, selected->data); } // delete old draggers for (GList const* i = this->draggers; i != NULL; i = i->next) { - delete ((GrDragger *) i->data); + delete static_cast(i->data); } - g_list_free (this->draggers); + g_list_free(this->draggers); this->draggers = NULL; - g_return_if_fail (this->selection != NULL); + g_return_if_fail(this->selection != NULL); for (GSList const* i = this->selection->itemList(); i != NULL; i = i->next) { - SPItem *item = SP_ITEM(i->data); - SPStyle *style = SP_OBJECT_STYLE (item); + SPStyle *style = item->style; if (style && (style->fill.isPaintserver())) { - SPObject *server = SP_OBJECT_STYLE_FILL_SERVER (item); - if (SP_IS_LINEARGRADIENT (server)) { - addDraggersLinear (SP_LINEARGRADIENT (server), item, true); - } else if (SP_IS_RADIALGRADIENT (server)) { - addDraggersRadial (SP_RADIALGRADIENT (server), item, true); + SPPaintServer *server = style->getFillPaintServer(); + if ( server && server->isSolid() ) { + // Suppress "gradientness" of solid paint + } else if ( SP_IS_LINEARGRADIENT(server) ) { + addDraggersLinear( SP_LINEARGRADIENT(server), item, true ); + } else if ( SP_IS_RADIALGRADIENT(server) ) { + addDraggersRadial( SP_RADIALGRADIENT(server), item, true ); } } if (style && (style->stroke.isPaintserver())) { - SPObject *server = SP_OBJECT_STYLE_STROKE_SERVER (item); - if (SP_IS_LINEARGRADIENT (server)) { - addDraggersLinear (SP_LINEARGRADIENT (server), item, false); - } else if (SP_IS_RADIALGRADIENT (server)) { - addDraggersRadial (SP_RADIALGRADIENT (server), item, false); + SPPaintServer *server = style->getStrokePaintServer(); + if ( server && server->isSolid() ) { + // Suppress "gradientness" of solid paint + } else if ( SP_IS_LINEARGRADIENT(server) ) { + addDraggersLinear( SP_LINEARGRADIENT(server), item, false ); + } else if ( SP_IS_RADIALGRADIENT(server) ) { + addDraggersRadial( SP_RADIALGRADIENT(server), item, false ); } } } -- cgit v1.2.3 From 5e0463d97c2a56fd7008750d8a897d3772bae946 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 3 Jul 2010 20:15:58 -0700 Subject: Suppress gradient direction line for 'solid' gradients. Removed unneeded and outdated macro use. (bzr r9564) --- src/gradient-drag.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'src/gradient-drag.cpp') diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 55348616e..8f0010925 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -1,5 +1,3 @@ -#define __GRADIENT_DRAG_C__ - /* * On-canvas gradient dragging * @@ -503,17 +501,18 @@ GrDraggable::~GrDraggable () } -SPObject * -GrDraggable::getServer () +SPObject *GrDraggable::getServer() { - if (!item) + if (!item) { return NULL; + } SPObject *server = NULL; - if (fill_or_stroke) - server = SP_OBJECT_STYLE_FILL_SERVER (item); - else - server = SP_OBJECT_STYLE_STROKE_SERVER (item); + if (fill_or_stroke) { + server = item->style->getFillPaintServer(); + }else { + server = item->style->getStrokePaintServer(); + } return server; } @@ -1705,10 +1704,12 @@ GrDrag::updateLines () SPStyle *style = SP_OBJECT_STYLE (item); if (style && (style->fill.isPaintserver())) { - SPObject *server = SP_OBJECT_STYLE_FILL_SERVER (item); - if (SP_IS_LINEARGRADIENT (server)) { + SPPaintServer *server = item->style->getFillPaintServer(); + if ( server && server->isSolid() ) { + // Suppress "gradientness" of solid paint + } else if ( SP_IS_LINEARGRADIENT(server) ) { this->addLine (item, sp_item_gradient_get_coords (item, POINT_LG_BEGIN, 0, true), sp_item_gradient_get_coords (item, POINT_LG_END, 0, true), GR_LINE_COLOR_FILL); - } else if (SP_IS_RADIALGRADIENT (server)) { + } else if ( SP_IS_RADIALGRADIENT(server) ) { Geom::Point center = sp_item_gradient_get_coords (item, POINT_RG_CENTER, 0, true); this->addLine (item, center, sp_item_gradient_get_coords (item, POINT_RG_R1, 0, true), GR_LINE_COLOR_FILL); this->addLine (item, center, sp_item_gradient_get_coords (item, POINT_RG_R2, 0, true), GR_LINE_COLOR_FILL); @@ -1716,10 +1717,12 @@ GrDrag::updateLines () } if (style && (style->stroke.isPaintserver())) { - SPObject *server = SP_OBJECT_STYLE_STROKE_SERVER (item); - if (SP_IS_LINEARGRADIENT (server)) { + SPPaintServer *server = item->style->getStrokePaintServer(); + if ( server && server->isSolid() ) { + // Suppress "gradientness" of solid paint + } else if ( SP_IS_LINEARGRADIENT(server) ) { this->addLine (item, sp_item_gradient_get_coords (item, POINT_LG_BEGIN, 0, false), sp_item_gradient_get_coords (item, POINT_LG_END, 0, false), GR_LINE_COLOR_STROKE); - } else if (SP_IS_RADIALGRADIENT (server)) { + } else if ( SP_IS_RADIALGRADIENT(server) ) { Geom::Point center = sp_item_gradient_get_coords (item, POINT_RG_CENTER, 0, false); this->addLine (item, center, sp_item_gradient_get_coords (item, POINT_RG_R1, 0, false), GR_LINE_COLOR_STROKE); this->addLine (item, center, sp_item_gradient_get_coords (item, POINT_RG_R2, 0, false), GR_LINE_COLOR_STROKE); -- cgit v1.2.3 From b33eae6f31e0016b7bb1d654cffce215277d3e39 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 11 Jul 2010 01:25:08 -0700 Subject: Stop setting of stops from getting url() reference colors. (bzr r9606) --- src/gradient-drag.cpp | 128 +++++++++++++++++++++++++++++++------------------- 1 file changed, 79 insertions(+), 49 deletions(-) (limited to 'src/gradient-drag.cpp') diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 8f0010925..25309dd61 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -176,41 +176,74 @@ gr_drag_style_query (SPStyle *style, int property, gpointer data) } } -bool -gr_drag_style_set (const SPCSSAttr *css, gpointer data) +bool GrDrag::styleSet( const SPCSSAttr *css ) { - GrDrag *drag = (GrDrag *) data; - - if (!drag->selected) + if (!selected) { return false; + } - SPCSSAttr *stop = sp_repr_css_attr_new (); + SPCSSAttr *stop = sp_repr_css_attr_new(); // See if the css contains interesting properties, and if so, translate them into the format // acceptable for gradient stops // any of color properties, in order of increasing priority: - if (css->attribute("flood-color")) + if (css->attribute("flood-color")) { sp_repr_css_set_property (stop, "stop-color", css->attribute("flood-color")); + } - if (css->attribute("lighting-color")) + if (css->attribute("lighting-color")) { sp_repr_css_set_property (stop, "stop-color", css->attribute("lighting-color")); + } - if (css->attribute("color")) + if (css->attribute("color")) { sp_repr_css_set_property (stop, "stop-color", css->attribute("color")); + } - if (css->attribute("stroke") && strcmp(css->attribute("stroke"), "none")) + if (css->attribute("stroke") && strcmp(css->attribute("stroke"), "none")) { sp_repr_css_set_property (stop, "stop-color", css->attribute("stroke")); + } - if (css->attribute("fill") && strcmp(css->attribute("fill"), "none")) + if (css->attribute("fill") && strcmp(css->attribute("fill"), "none")) { sp_repr_css_set_property (stop, "stop-color", css->attribute("fill")); + } - if (css->attribute("stop-color")) + if (css->attribute("stop-color")) { sp_repr_css_set_property (stop, "stop-color", css->attribute("stop-color")); + } + + // Make sure the style is allowed for gradient stops. + if ( !sp_repr_css_property_is_unset( stop, "stop-color") ) { + Glib::ustring tmp = sp_repr_css_property( stop, "stop-color", "" ); + Glib::ustring::size_type pos = tmp.find("url(#"); + if ( pos != Glib::ustring::npos ) { + Glib::ustring targetName = tmp.substr(pos + 5, tmp.length() - 6); + const GSList *gradients = sp_document_get_resource_list(desktop->doc(), "gradient"); + for (const GSList *item = gradients; item; item = item->next) { + SPGradient* grad = SP_GRADIENT(item->data); + if ( targetName == grad->getId() ) { + SPGradient *vect = grad->getVector(); + SPStop *firstStop = (vect) ? vect->getFirstStop() : grad->getFirstStop(); + if (firstStop) { + Glib::ustring stopColorStr; + if (firstStop->currentColor) { + stopColorStr = sp_object_get_style_property(firstStop, "color", NULL); + } else { + stopColorStr = firstStop->specified_color.toString(); + } + if ( !stopColorStr.empty() ) { + sp_repr_css_set_property( stop, "stop-color", stopColorStr.c_str() ); + } + } + break; + } + } + } + } if (css->attribute("stop-opacity")) { // direct setting of stop-opacity has priority - sp_repr_css_set_property (stop, "stop-opacity", css->attribute("stop-opacity")); + sp_repr_css_set_property(stop, "stop-opacity", css->attribute("stop-opacity")); } else { // multiply all opacity properties: gdouble accumulated = 1.0; accumulated *= sp_svg_read_percentage(css->attribute("flood-opacity"), 1.0); @@ -220,11 +253,12 @@ gr_drag_style_set (const SPCSSAttr *css, gpointer data) Inkscape::CSSOStringStream os; os << accumulated; - sp_repr_css_set_property (stop, "stop-opacity", os.str().c_str()); + sp_repr_css_set_property(stop, "stop-opacity", os.str().c_str()); if ((css->attribute("fill") && !css->attribute("stroke") && !strcmp(css->attribute("fill"), "none")) || - (css->attribute("stroke") && !css->attribute("fill") && !strcmp(css->attribute("stroke"), "none"))) - sp_repr_css_set_property (stop, "stop-opacity", "0"); // if a single fill/stroke property is set to none, don't change color, set opacity to 0 + (css->attribute("stroke") && !css->attribute("fill") && !strcmp(css->attribute("stroke"), "none"))) { + sp_repr_css_set_property(stop, "stop-opacity", "0"); // if a single fill/stroke property is set to none, don't change color, set opacity to 0 + } } if (!stop->attributeList()) { // nothing for us here, pass it on @@ -232,13 +266,13 @@ gr_drag_style_set (const SPCSSAttr *css, gpointer data) return false; } - for (GList const* sel = drag->selected; sel != NULL; sel = sel->next) { // for all selected draggers - GrDragger* dragger = (GrDragger*) sel->data; + for (GList const* sel = selected; sel != NULL; sel = sel->next) { // for all selected draggers + GrDragger* dragger = reinterpret_cast(sel->data); for (GSList const* i = dragger->draggables; i != NULL; i = i->next) { // for all draggables of dragger - GrDraggable *draggable = (GrDraggable *) i->data; + GrDraggable *draggable = reinterpret_cast(i->data); - drag->local_change = true; - sp_item_gradient_stop_set_style (draggable->item, draggable->point_type, draggable->point_i, draggable->fill_or_stroke, stop); + local_change = true; + sp_item_gradient_stop_set_style(draggable->item, draggable->point_type, draggable->point_i, draggable->fill_or_stroke, stop); } } @@ -402,51 +436,47 @@ GrDrag::dropColor(SPItem */*item*/, gchar const *c, Geom::Point p) } -GrDrag::GrDrag(SPDesktop *desktop) { - - this->desktop = desktop; - - this->selection = sp_desktop_selection(desktop); - - this->draggers = NULL; - this->lines = NULL; - this->selected = NULL; - - this->hor_levels.clear(); - this->vert_levels.clear(); - - this->local_change = false; - - this->sel_changed_connection = this->selection->connectChanged( - sigc::bind ( +GrDrag::GrDrag(SPDesktop *desktop) : + selected(0), + keep_selection(false), + local_change(false), + desktop(desktop), + hor_levels(), + vert_levels(), + draggers(0), + lines(0), + selection(sp_desktop_selection(desktop)), + sel_changed_connection(), + sel_modified_connection(), + style_set_connection(), + style_query_connection() +{ + sel_changed_connection = selection->connectChanged( + sigc::bind( sigc::ptr_fun(&gr_drag_sel_changed), (gpointer)this ) ); - this->sel_modified_connection = this->selection->connectModified( + sel_modified_connection = selection->connectModified( sigc::bind( sigc::ptr_fun(&gr_drag_sel_modified), (gpointer)this ) ); - this->style_set_connection = this->desktop->connectSetStyle( - sigc::bind( - sigc::ptr_fun(&gr_drag_style_set), - (gpointer)this ) - ); + style_set_connection = desktop->connectSetStyle( sigc::mem_fun(*this, &GrDrag::styleSet) ); - this->style_query_connection = this->desktop->connectQueryStyle( + style_query_connection = desktop->connectQueryStyle( sigc::bind( sigc::ptr_fun(&gr_drag_style_query), (gpointer)this ) ); - this->updateDraggers (); - this->updateLines (); - this->updateLevels (); + updateDraggers(); + updateLines(); + updateLevels(); if (desktop->gr_item) { - this->setSelected (getDraggerFor (desktop->gr_item, desktop->gr_point_type, desktop->gr_point_i, desktop->gr_fill_or_stroke)); + setSelected(getDraggerFor(desktop->gr_item, desktop->gr_point_type, desktop->gr_point_i, desktop->gr_fill_or_stroke)); } } -- cgit v1.2.3 From 35300c9822f9f84c8a011913235fd4e5dc2c5ac8 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Mon, 12 Jul 2010 07:51:13 +0200 Subject: - Snap while rotating an object using the selector tool - Rename the ConstraintLine class to SnapConstraint - Move some duplicated code to 2geom (bzr r9607) --- src/gradient-drag.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gradient-drag.cpp') diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 25309dd61..1492e9008 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -688,7 +688,7 @@ gr_knot_moved_handler(SPKnot *knot, Geom::Point const &ppointer, guint state, gp snap_vector = get_snap_vector (p, dr_snap, M_PI/snaps, 0); } if (snap_vector) { - Inkscape::Snapper::ConstraintLine cl(dr_snap, p + *snap_vector - dr_snap); + Inkscape::Snapper::SnapConstraint cl(dr_snap, p + *snap_vector - dr_snap); Inkscape::SnappedPoint s = m.constrainedSnap(Inkscape::SnapCandidatePoint(p + *snap_vector, Inkscape::SNAPSOURCE_OTHER_HANDLE), cl); if (s.getSnapped()) { s.setTransformation(s.getPoint() - p); @@ -838,7 +838,7 @@ gr_knot_moved_midpoint_handler(SPKnot */*knot*/, Geom::Point const &ppointer, gu } else { p = snap_vector_midpoint (p, low_lim, high_lim, 0); if (!(state & GDK_SHIFT_MASK)) { - Inkscape::Snapper::ConstraintLine cl(low_lim, high_lim - low_lim); + Inkscape::Snapper::SnapConstraint cl(low_lim, high_lim - low_lim); SPDesktop *desktop = dragger->parent->desktop; SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop); -- cgit v1.2.3 From 481d61d14a18ea012527b6b93590bff6ad75ba33 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 17 Jul 2010 17:24:31 -0700 Subject: Correct behavior of gradient stops to extract color from swatch when color is drag-n-drop'ed or selected. (bzr r9620) --- src/gradient-drag.cpp | 77 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 28 deletions(-) (limited to 'src/gradient-drag.cpp') diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 1492e9008..e7536a86a 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -176,6 +176,43 @@ gr_drag_style_query (SPStyle *style, int property, gpointer data) } } +Glib::ustring GrDrag::makeStopSafeColor( gchar const *str, bool &isNull ) +{ + Glib::ustring colorStr; + if ( str ) { + isNull = false; + colorStr = str; + Glib::ustring::size_type pos = colorStr.find("url(#"); + if ( pos != Glib::ustring::npos ) { + Glib::ustring targetName = colorStr.substr(pos + 5, colorStr.length() - 6); + const GSList *gradients = sp_document_get_resource_list(desktop->doc(), "gradient"); + for (const GSList *item = gradients; item; item = item->next) { + SPGradient* grad = SP_GRADIENT(item->data); + if ( targetName == grad->getId() ) { + SPGradient *vect = grad->getVector(); + SPStop *firstStop = (vect) ? vect->getFirstStop() : grad->getFirstStop(); + if (firstStop) { + Glib::ustring stopColorStr; + if (firstStop->currentColor) { + stopColorStr = sp_object_get_style_property(firstStop, "color", NULL); + } else { + stopColorStr = firstStop->specified_color.toString(); + } + if ( !stopColorStr.empty() ) { + colorStr = stopColorStr; + } + } + break; + } + } + } + } else { + isNull = true; + } + + return colorStr; +} + bool GrDrag::styleSet( const SPCSSAttr *css ) { if (!selected) { @@ -214,30 +251,10 @@ bool GrDrag::styleSet( const SPCSSAttr *css ) // Make sure the style is allowed for gradient stops. if ( !sp_repr_css_property_is_unset( stop, "stop-color") ) { - Glib::ustring tmp = sp_repr_css_property( stop, "stop-color", "" ); - Glib::ustring::size_type pos = tmp.find("url(#"); - if ( pos != Glib::ustring::npos ) { - Glib::ustring targetName = tmp.substr(pos + 5, tmp.length() - 6); - const GSList *gradients = sp_document_get_resource_list(desktop->doc(), "gradient"); - for (const GSList *item = gradients; item; item = item->next) { - SPGradient* grad = SP_GRADIENT(item->data); - if ( targetName == grad->getId() ) { - SPGradient *vect = grad->getVector(); - SPStop *firstStop = (vect) ? vect->getFirstStop() : grad->getFirstStop(); - if (firstStop) { - Glib::ustring stopColorStr; - if (firstStop->currentColor) { - stopColorStr = sp_object_get_style_property(firstStop, "color", NULL); - } else { - stopColorStr = firstStop->specified_color.toString(); - } - if ( !stopColorStr.empty() ) { - sp_repr_css_set_property( stop, "stop-color", stopColorStr.c_str() ); - } - } - break; - } - } + bool stopIsNull = false; + Glib::ustring tmp = makeStopSafeColor( sp_repr_css_property( stop, "stop-color", "" ), stopIsNull ); + if ( !stopIsNull && !tmp.empty() ) { + sp_repr_css_set_property( stop, "stop-color", tmp.c_str() ); } } @@ -393,14 +410,18 @@ GrDrag::addStopNearPoint (SPItem *item, Geom::Point mouse_p, double tolerance) bool GrDrag::dropColor(SPItem */*item*/, gchar const *c, Geom::Point p) { + // Note: not sure if a null pointer can come in for the style, but handle that just in case + bool stopIsNull = false; + Glib::ustring toUse = makeStopSafeColor( c, stopIsNull ); + // first, see if we can drop onto one of the existing draggers for (GList *i = draggers; i != NULL; i = i->next) { // for all draggables of dragger GrDragger *d = (GrDragger *) i->data; if (Geom::L2(p - d->point)*desktop->current_zoom() < 5) { SPCSSAttr *stop = sp_repr_css_attr_new (); - sp_repr_css_set_property (stop, "stop-color", c); - sp_repr_css_set_property (stop, "stop-opacity", "1"); + sp_repr_css_set_property( stop, "stop-color", stopIsNull ? 0 : toUse.c_str() ); + sp_repr_css_set_property( stop, "stop-opacity", "1" ); for (GSList *j = d->draggables; j != NULL; j = j->next) { // for all draggables of dragger GrDraggable *draggable = (GrDraggable *) j->data; local_change = true; @@ -423,8 +444,8 @@ GrDrag::dropColor(SPItem */*item*/, gchar const *c, Geom::Point p) SPStop *stop = addStopNearPoint (line->item, p, 5/desktop->current_zoom()); if (stop) { SPCSSAttr *css = sp_repr_css_attr_new (); - sp_repr_css_set_property (css, "stop-color", c); - sp_repr_css_set_property (css, "stop-opacity", "1"); + sp_repr_css_set_property( css, "stop-color", stopIsNull ? 0 : toUse.c_str() ); + sp_repr_css_set_property( css, "stop-opacity", "1" ); sp_repr_css_change (SP_OBJECT_REPR (stop), css, "style"); return true; } -- cgit v1.2.3