=== modified file 'src/display/canvas-bpath.cpp' --- src/display/canvas-bpath.cpp 2014-10-08 02:22:03 +0000 +++ src/display/canvas-bpath.cpp 2016-07-06 21:44:59 +0000 @@ -53,6 +53,7 @@ bpath->stroke_linejoin = SP_STROKE_LINEJOIN_MITER; bpath->stroke_linecap = SP_STROKE_LINECAP_BUTT; bpath->stroke_miterlimit = 11.0; + bpath->phantom_line = false; } static void sp_canvas_bpath_destroy(SPCanvasItem *object) @@ -71,7 +72,7 @@ { SPCanvasBPath *cbp = SP_CANVAS_BPATH(item); - item->canvas->requestRedraw((int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2); + item->canvas->requestRedraw((int)item->x1 - 1, (int)item->y1 - 1, (int)item->x2 + 1 , (int)item->y2 + 1); if (reinterpret_cast(sp_canvas_bpath_parent_class)->update) { reinterpret_cast(sp_canvas_bpath_parent_class)->update(item, affine, flags); @@ -86,10 +87,10 @@ Geom::OptRect bbox = bounds_exact_transformed(cbp->curve->get_pathvector(), affine); if (bbox) { - item->x1 = (int)bbox->min()[Geom::X] - 1; - item->y1 = (int)bbox->min()[Geom::Y] - 1; - item->x2 = (int)bbox->max()[Geom::X] + 1; - item->y2 = (int)bbox->max()[Geom::Y] + 1; + item->x1 = (int)floor(bbox->min()[Geom::X]) - 1; + item->y1 = (int)floor(bbox->min()[Geom::Y]) - 1; + item->x2 = (int)ceil(bbox->max()[Geom::X]) + 1; + item->y2 = (int)ceil(bbox->max()[Geom::Y]) + 1; } else { item->x1 = 0; item->y1 = 0; @@ -131,7 +132,21 @@ cairo_fill_preserve(buf->ct); } - if (dostroke) { + if (dostroke && cbp->phantom_line) { + ink_cairo_set_source_rgba32(buf->ct, 0xffffff7f); + cairo_set_line_width(buf->ct, 2); + if (cbp->dashes[0] != 0 && cbp->dashes[1] != 0) { + cairo_set_dash (buf->ct, cbp->dashes, 2, 0); + } + cairo_stroke(buf->ct); + cairo_set_tolerance(buf->ct, 0.5); + cairo_new_path(buf->ct); + feed_pathvector_to_cairo (buf->ct, cbp->curve->get_pathvector(), cbp->affine, area, + /* optimized_stroke = */ !dofill, 1); + ink_cairo_set_source_rgba32(buf->ct, cbp->stroke_rgba); + cairo_set_line_width(buf->ct, 1); + cairo_stroke(buf->ct); + } else if (dostroke) { ink_cairo_set_source_rgba32(buf->ct, cbp->stroke_rgba); cairo_set_line_width(buf->ct, 1); if (cbp->dashes[0] != 0 && cbp->dashes[1] != 0) { @@ -167,24 +182,25 @@ } SPCanvasItem * -sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve) +sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve, bool phantom_line) { g_return_val_if_fail (parent != NULL, NULL); g_return_val_if_fail (SP_IS_CANVAS_GROUP (parent), NULL); SPCanvasItem *item = sp_canvas_item_new (parent, SP_TYPE_CANVAS_BPATH, NULL); - sp_canvas_bpath_set_bpath (SP_CANVAS_BPATH (item), curve); + sp_canvas_bpath_set_bpath (SP_CANVAS_BPATH (item), curve, phantom_line); return item; } void -sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve) +sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve, bool phantom_line) { g_return_if_fail (cbp != NULL); g_return_if_fail (SP_IS_CANVAS_BPATH (cbp)); + cbp->phantom_line = phantom_line; if (cbp->curve) { cbp->curve = cbp->curve->unref(); } === modified file 'src/display/canvas-bpath.h' --- src/display/canvas-bpath.h 2014-03-27 01:33:44 +0000 +++ src/display/canvas-bpath.h 2016-07-06 18:30:35 +0000 @@ -80,7 +80,7 @@ SPStrokeJoinType stroke_linejoin; SPStrokeCapType stroke_linecap; gdouble stroke_miterlimit; - + bool phantom_line; /* State */ Shape *fill_shp; Shape *stroke_shp; @@ -92,9 +92,9 @@ GType sp_canvas_bpath_get_type (void); -SPCanvasItem *sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve); +SPCanvasItem *sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve, bool phantom_line = false); -void sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve); +void sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve, bool phantom_line = false); void sp_canvas_bpath_set_fill (SPCanvasBPath *cbp, guint32 rgba, SPWindRule rule); void sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap, double dash=0, double gap=0); === modified file 'src/display/sp-ctrlline.cpp' --- src/display/sp-ctrlline.cpp 2014-08-24 15:20:54 +0000 +++ src/display/sp-ctrlline.cpp 2016-07-06 21:45:22 +0000 @@ -84,7 +84,7 @@ Geom::Point s = cl->s * cl->affine; Geom::Point e = cl->e * cl->affine; - ink_cairo_set_source_rgba32(buf->ct, 0xffffffbf); + ink_cairo_set_source_rgba32(buf->ct, 0xffffff7f); cairo_set_line_width(buf->ct, 2); cairo_new_path(buf->ct); === modified file 'src/ui/control-manager.cpp' --- src/ui/control-manager.cpp 2016-04-02 18:21:12 +0000 +++ src/ui/control-manager.cpp 2016-07-06 21:44:31 +0000 @@ -149,7 +149,7 @@ _ctrlToShape[CTRL_TYPE_NODE_AUTO] = SP_CTRL_SHAPE_CIRCLE; _ctrlToShape[CTRL_TYPE_NODE_SYMETRICAL] = SP_CTRL_SHAPE_SQUARE; - _ctrlToShape[CTRL_TYPE_ADJ_HANDLE] = SP_CTRL_SHAPE_CIRCLE; + _ctrlToShape[CTRL_TYPE_ADJ_HANDLE] =SP_CTRL_SHAPE_CIRCLE; _ctrlToShape[CTRL_TYPE_INVISIPOINT] = SP_CTRL_SHAPE_SQUARE; // ------- @@ -223,10 +223,10 @@ { case CTRL_TYPE_ADJ_HANDLE: item = sp_canvas_item_new(parent, SP_TYPE_CTRL, - "shape", SP_CTRL_SHAPE_CIRCLE, + "shape",SP_CTRL_SHAPE_CIRCLE, "size", targetSize, - "filled", 0, - "fill_color", 0xff00007f, + "filled", 1, + "fill_color", 0xffffff7f, "stroked", 1, "stroke_color", 0x0000ff7f, NULL); === modified file 'src/ui/tools/calligraphic-tool.cpp' --- src/ui/tools/calligraphic-tool.cpp 2015-05-22 08:23:27 +0000 +++ src/ui/tools/calligraphic-tool.cpp 2016-07-06 18:52:52 +0000 @@ -144,7 +144,7 @@ SPCurve *c = new SPCurve(path); - this->hatch_area = sp_canvas_bpath_new(this->desktop->getControls(), c); + this->hatch_area = sp_canvas_bpath_new(this->desktop->getControls(), c, true); c->unref(); @@ -1099,7 +1099,7 @@ add_cap(this->currentcurve, b2[0], b1[0], this->cap_rounding); } this->currentcurve->closepath(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve, true); } /* Current calligraphic */ @@ -1135,7 +1135,7 @@ SP_TYPE_CANVAS_BPATH, NULL); SPCurve *curve = this->currentcurve->copy(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH (cbp), curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH (cbp), curve, true); curve->unref(); guint32 fillColor = sp_desktop_get_color_tool (desktop, "/tools/calligraphic", true); @@ -1179,7 +1179,7 @@ } this->currentcurve->closepath(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve, true); } } === modified file 'src/ui/tools/connector-tool.cpp' --- src/ui/tools/connector-tool.cpp 2016-04-12 10:35:15 +0000 +++ src/ui/tools/connector-tool.cpp 2016-07-06 18:46:43 +0000 @@ -627,7 +627,7 @@ this->red_curve = path->get_curve_for_edit(); this->red_curve->transform(i2d); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve, true); ret = true; break; } @@ -818,7 +818,7 @@ // Recreate curve from libavoid route. recreateCurve( this->red_curve, this->newConnRef, this->curvature ); this->red_curve->transform(desktop->doc2dt()); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve, true); } @@ -1042,7 +1042,7 @@ cc->red_curve = SP_PATH(cc->clickeditem)->get_curve_for_edit(); Geom::Affine i2d = (cc->clickeditem)->i2dt_affine(); cc->red_curve->transform(i2d); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(cc->red_bpath), cc->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(cc->red_bpath), cc->red_curve, true); cc->clickeditem->setHidden(true); === modified file 'src/ui/tools/eraser-tool.cpp' --- src/ui/tools/eraser-tool.cpp 2016-03-04 19:19:00 +0000 +++ src/ui/tools/eraser-tool.cpp 2016-07-06 18:50:39 +0000 @@ -955,7 +955,7 @@ } this->currentcurve->closepath(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve, true); } /* Current eraser */ @@ -992,7 +992,7 @@ SPCanvasItem *cbp = sp_canvas_item_new(desktop->getSketch(), SP_TYPE_CANVAS_BPATH, NULL); SPCurve *curve = this->currentcurve->copy(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH (cbp), curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH (cbp), curve, true); curve->unref(); guint32 fillColor = sp_desktop_get_color_tool (desktop, "/tools/eraser", true); @@ -1041,7 +1041,7 @@ } this->currentcurve->closepath(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), this->currentcurve, true); } } === modified file 'src/ui/tools/node-tool.cpp' --- src/ui/tools/node-tool.cpp 2016-05-21 18:22:10 +0000 +++ src/ui/tools/node-tool.cpp 2016-07-06 21:57:07 +0000 @@ -311,7 +311,7 @@ cc->reset(); } if (!c->is_empty()) { - SPCanvasItem *helperpath = sp_canvas_bpath_new(this->desktop->getTempGroup(), c); + SPCanvasItem *helperpath = sp_canvas_bpath_new(this->desktop->getTempGroup(), c, true); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath), 0x0000ff9A, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath), 0, SP_WIND_RULE_NONZERO); sp_canvas_item_affine_absolute(helperpath, selection->singleItem()->i2dt_affine()); @@ -532,7 +532,7 @@ } c->transform(over_item->i2dt_affine()); - SPCanvasItem *flash = sp_canvas_bpath_new(desktop->getTempGroup(), c); + SPCanvasItem *flash = sp_canvas_bpath_new(desktop->getTempGroup(), c, true); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(flash), //prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff), 1.0, === modified file 'src/ui/tools/pen-tool.cpp' --- src/ui/tools/pen-tool.cpp 2016-03-20 13:21:29 +0000 +++ src/ui/tools/pen-tool.cpp 2016-07-06 20:57:30 +0000 @@ -877,7 +877,7 @@ this->green_bpaths = g_slist_remove(this->green_bpaths, this->green_bpaths->data); } // one canvas bpath for all of green_curve - SPCanvasItem *canvas_shape = sp_canvas_bpath_new(this->desktop->getSketch(), this->green_curve); + SPCanvasItem *canvas_shape = sp_canvas_bpath_new(this->desktop->getSketch(), this->green_curve, true); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(canvas_shape), this->green_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(canvas_shape), 0, SP_WIND_RULE_NONZERO); @@ -889,7 +889,7 @@ this->red_curve->reset(); this->red_curve->moveto(this->p[0]); this->red_curve->curveto(this->p[1], this->p[2], this->p[3]); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve, true); // handles // hide the handlers in bspline and spiro modes @@ -1263,10 +1263,10 @@ void PenTool::_resetColors() { // Red this->red_curve->reset(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL, true); // Blue this->blue_curve->reset(); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), NULL); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), NULL, true); // Green while (this->green_bpaths) { sp_canvas_item_destroy(SP_CANVAS_ITEM(this->green_bpaths->data)); @@ -1289,7 +1289,7 @@ this->p[0] = p; this->p[1] = p; this->npoints = 2; - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL, true); this->desktop->canvas->forceFullRedrawAfterInterruptions(5); } @@ -1355,7 +1355,7 @@ this->green_bpaths = g_slist_remove(this->green_bpaths, this->green_bpaths->data); } // one canvas bpath for all of green_curve - SPCanvasItem *canvas_shape = sp_canvas_bpath_new(this->desktop->getSketch(), this->green_curve); + SPCanvasItem *canvas_shape = sp_canvas_bpath_new(this->desktop->getSketch(), this->green_curve, true); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(canvas_shape), this->green_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(canvas_shape), 0, SP_WIND_RULE_NONZERO); this->green_bpaths = g_slist_prepend(this->green_bpaths, canvas_shape); @@ -1713,7 +1713,7 @@ }else{ this->red_curve->curveto(this->p[1],this->p[2],this->p[3]); } - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve, true); curve->append_continuous(this->red_curve, 0.0625); } @@ -1734,7 +1734,7 @@ LivePathEffect::sp_spiro_do_effect(curve); } - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), curve, true); 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(); @@ -1790,7 +1790,7 @@ } } - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve, true); if (statusbar) { gchar *message = is_curve ? @@ -1830,7 +1830,7 @@ this->red_curve->reset(); this->red_curve->moveto(this->p[0]); this->red_curve->curveto(this->p[1], this->p[2], this->p[3]); - sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve, true); } SP_CTRL(this->c0)->moveto(this->p[2]); this->cl0 ->setCoords(this->p[3], this->p[2]); @@ -1862,7 +1862,7 @@ SPCurve *curve = this->red_curve->copy(); /// \todo fixme: - SPCanvasItem *canvas_shape = sp_canvas_bpath_new(this->desktop->getSketch(), curve); + SPCanvasItem *canvas_shape = sp_canvas_bpath_new(this->desktop->getSketch(), curve, true); curve->unref(); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(canvas_shape), this->green_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); === modified file 'src/ui/tools/pencil-tool.cpp' --- src/ui/tools/pencil-tool.cpp 2016-03-02 19:44:36 +0000 +++ src/ui/tools/pencil-tool.cpp 2016-07-06 18:47:41 +0000 @@ -852,7 +852,7 @@ SPCurve *curve = this->red_curve->copy(); /// \todo fixme: - SPCanvasItem *cshape = sp_canvas_bpath_new(this->desktop->getSketch(), curve); + SPCanvasItem *cshape = sp_canvas_bpath_new(this->desktop->getSketch(), curve, true); curve->unref(); this->highlight_color = SP_ITEM(this->desktop->currentLayer())->highlight_color();