diff options
Diffstat (limited to 'src/ui/tools/gradient-tool.cpp')
| -rw-r--r-- | src/ui/tools/gradient-tool.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/ui/tools/gradient-tool.cpp b/src/ui/tools/gradient-tool.cpp index e4ab7b424..a0bbfbaf1 100644 --- a/src/ui/tools/gradient-tool.cpp +++ b/src/ui/tools/gradient-tool.cpp @@ -74,20 +74,16 @@ const std::string& GradientTool::getPrefsPath() { const std::string GradientTool::prefsPath = "/tools/gradient"; -GradientTool::GradientTool() : ToolBase() { - this->node_added = false; - this->subselcon = 0; - this->selcon = 0; - - this->cursor_addnode = false; - this->cursor_shape = cursor_gradient_xpm; - this->hot_x = 4; - this->hot_y = 4; - this->xp = 0; - this->yp = 0; +GradientTool::GradientTool() + : ToolBase(cursor_gradient_xpm, 4, 4) + , cursor_addnode(false) + , node_added(false) +// TODO: Why are these connections stored as pointers? + , selcon(NULL) + , subselcon(NULL) +{ + // TODO: This value is overwritten in the root handler this->tolerance = 6; - this->within_tolerance = false; - this->item_to_select = NULL; } GradientTool::~GradientTool() { @@ -339,10 +335,12 @@ sp_gradient_context_add_stops_between_selected_stops (GradientTool *rc) SPGradient *gradient = getGradient(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 = this_stop->getNextStop(); - if (this_stop && next_stop) { - these_stops = g_slist_prepend (these_stops, this_stop); - next_stops = g_slist_prepend (next_stops, next_stop); + if (this_stop) { + SPStop *next_stop = this_stop->getNextStop(); + if (next_stop) { + these_stops = g_slist_prepend (these_stops, this_stop); + next_stops = g_slist_prepend (next_stops, next_stop); + } } } } |
