summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/freehand-base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/tools/freehand-base.cpp')
-rw-r--r--src/ui/tools/freehand-base.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index 31d2f6191..cb6111bd5 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -82,6 +82,8 @@ 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)
@@ -137,6 +139,13 @@ 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();
@@ -483,6 +492,10 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed)
dc->red_curve->reset();
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->red_bpath), NULL);
+ // Blue2
+ dc->blue2_curve->reset();
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->blue2_bpath), NULL);
+
//spanish: si c esta vacio, puede ser que se haya tratado de contnuar una curva existente
//y se haya cancelado. Si es asi y el modo es bspline o spirolive la curva previa necesita volver a ser seleccionada
//porque la modificamos al continuar por un anchor
@@ -718,6 +731,15 @@ 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));