summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-09-24 02:56:55 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-09-24 02:56:55 +0000
commit9cf38f99fc246131a2f2d9c3c55617488003b3b4 (patch)
treef9a6622804912b2e5437f395c369070686db0f7b /src
parentChange colors of helper paths also in middle draw when change the mode -spiro... (diff)
downloadinkscape-9cf38f99fc246131a2f2d9c3c55617488003b3b4.tar.gz
inkscape-9cf38f99fc246131a2f2d9c3c55617488003b3b4.zip
A bit refactor, remove some old vars
(bzr r13341.1.223)
Diffstat (limited to 'src')
-rw-r--r--src/ui/tools/freehand-base.cpp22
-rw-r--r--src/ui/tools/freehand-base.h4
-rw-r--r--src/ui/tools/pen-tool.cpp15
3 files changed, 6 insertions, 35 deletions
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index bc979821a..46ab53eef 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -85,8 +85,6 @@ FreehandBase::FreehandBase(gchar const *const *cursor_shape, gint hot_x, gint ho
, red_curve(NULL)
, blue_bpath(NULL)
, blue_curve(NULL)
- , blue2_bpath(NULL)
- , blue2_curve(NULL)
, green_bpaths(NULL)
, green_curve(NULL)
, green_anchor(NULL)
@@ -143,13 +141,6 @@ void FreehandBase::setup() {
// Create blue curve
this->blue_curve = new SPCurve();
- // Create blue2 bpath
- this->blue2_bpath = sp_canvas_bpath_new(sp_desktop_sketch(this->desktop), NULL);
- sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->blue2_bpath), this->blue_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
-
- // Create blue2 curve
- this->blue2_curve = new SPCurve();
-
// Create green curve
this->green_curve = new SPCurve();
@@ -550,10 +541,6 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed)
dc->blue_curve->reset();
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->blue_bpath), NULL);
- // Blue2
- dc->blue2_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->blue2_bpath), NULL);
-
// Red
if (dc->red_curve_is_valid) {
c->append_continuous(dc->red_curve, 0.0625);
@@ -791,15 +778,6 @@ static void spdc_free_colors(FreehandBase *dc)
dc->blue_curve = dc->blue_curve->unref();
}
- // Blue2
- if (dc->blue2_bpath) {
- sp_canvas_item_destroy(SP_CANVAS_ITEM(dc->blue2_bpath));
- dc->blue2_bpath = NULL;
- }
- if (dc->blue2_curve) {
- dc->blue2_curve = dc->blue2_curve->unref();
- }
-
// Green
while (dc->green_bpaths) {
sp_canvas_item_destroy(SP_CANVAS_ITEM(dc->green_bpaths->data));
diff --git a/src/ui/tools/freehand-base.h b/src/ui/tools/freehand-base.h
index fb2db86f6..6b4265215 100644
--- a/src/ui/tools/freehand-base.h
+++ b/src/ui/tools/freehand-base.h
@@ -65,10 +65,6 @@ public:
SPCanvasItem *blue_bpath;
SPCurve *blue_curve;
- // Blue2
- SPCanvasItem *blue2_bpath;
- SPCurve *blue2_curve;
-
// Green
GSList *green_bpaths;
SPCurve *green_curve;
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp
index ecd10b068..2c5ffc182 100644
--- a/src/ui/tools/pen-tool.cpp
+++ b/src/ui/tools/pen-tool.cpp
@@ -1327,9 +1327,6 @@ void PenTool::_resetColors() {
// Blue
this->blue_curve->reset();
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), NULL);
- // Blue2
- this->blue2_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue2_bpath), NULL);
// Green
while (this->green_bpaths) {
sp_canvas_item_destroy(SP_CANVAS_ITEM(this->green_bpaths->data));
@@ -1407,7 +1404,7 @@ void PenTool::_bspline_spiro_color()
} else {
this->green_color = this->highlight_color;
}
- sp_canvas_item_hide(this->blue2_bpath);
+ sp_canvas_item_hide(this->blue_bpath);
}
//We erase all the "green_bpaths" to recreate them after with the colour
//transparency recently modified
@@ -1792,11 +1789,11 @@ void PenTool::_bspline_spiro_build()
this->_spiro_doEffect(curve);
}
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue2_bpath), curve);
- sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->blue2_bpath), this->blue_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
- sp_canvas_item_show(this->blue2_bpath);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), curve);
+ sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->blue_bpath), this->blue_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
+ sp_canvas_item_show(this->blue_bpath);
curve->unref();
- this->blue2_curve->reset();
+ this->blue_curve->reset();
//We hide the holders that doesn't contribute anything
if(this->spiro){
sp_canvas_item_show(this->c1);
@@ -1808,7 +1805,7 @@ void PenTool::_bspline_spiro_build()
sp_canvas_item_hide(this->cl0);
}else{
//if the curve is empty
- sp_canvas_item_hide(this->blue2_bpath);
+ sp_canvas_item_hide(this->blue_bpath);
}
}