diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-08-29 20:39:07 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-08-29 20:39:07 +0000 |
| commit | 1b8b972f1e0d6ee32c1f85514ec334c654d1e29c (patch) | |
| tree | 49e23896ee567d33e7c5dcaf31ecb7402cf80673 /src/ui/tools | |
| parent | Fix a bug in pattern along path at first edit node after applied. Backport it... (diff) | |
| download | inkscape-1b8b972f1e0d6ee32c1f85514ec334c654d1e29c.tar.gz inkscape-1b8b972f1e0d6ee32c1f85514ec334c654d1e29c.zip | |
Partial fix for bug 172063 while we find a better solution for XOR in helper lines
(bzr r15090)
Diffstat (limited to 'src/ui/tools')
| -rw-r--r-- | src/ui/tools/calligraphic-tool.cpp | 8 | ||||
| -rw-r--r-- | src/ui/tools/connector-tool.cpp | 6 | ||||
| -rw-r--r-- | src/ui/tools/eraser-tool.cpp | 6 | ||||
| -rw-r--r-- | src/ui/tools/node-tool.cpp | 15 | ||||
| -rw-r--r-- | src/ui/tools/node-tool.h | 1 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 22 | ||||
| -rw-r--r-- | src/ui/tools/pencil-tool.cpp | 2 |
7 files changed, 23 insertions, 37 deletions
diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp index d623035d9..9b4dbb1a2 100644 --- a/src/ui/tools/calligraphic-tool.cpp +++ b/src/ui/tools/calligraphic-tool.cpp @@ -135,7 +135,7 @@ void CalligraphicTool::setup() { 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(); @@ -1090,7 +1090,7 @@ void CalligraphicTool::fit_and_split(bool release) { 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 */ @@ -1126,7 +1126,7 @@ void CalligraphicTool::fit_and_split(bool release) { 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); @@ -1170,7 +1170,7 @@ void CalligraphicTool::draw_temporary_box() { } 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); } } diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp index 84f7f318c..7e6fb4b72 100644 --- a/src/ui/tools/connector-tool.cpp +++ b/src/ui/tools/connector-tool.cpp @@ -620,7 +620,7 @@ bool ConnectorTool::_handleMotionNotify(GdkEventMotion const &mevent) { 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; } @@ -811,7 +811,7 @@ void ConnectorTool::_setSubsequentPoint(Geom::Point const p) { // 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); } @@ -1035,7 +1035,7 @@ endpt_handler(SPKnot */*knot*/, GdkEvent *event, ConnectorTool *cc) 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); diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index d18db8266..4b40262cd 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -943,7 +943,7 @@ void EraserTool::fit_and_split(bool release) { } 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 */ @@ -980,7 +980,7 @@ void EraserTool::fit_and_split(bool release) { 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); @@ -1029,7 +1029,7 @@ void EraserTool::draw_temporary_box() { } 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); } } diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index c266db05c..b4fc569bb 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -158,9 +158,6 @@ NodeTool::~NodeTool() { if (this->helperpath_tmpitem) { this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem); } - if (this->helperpath_tmpitem_highlight) { - this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem_highlight); - } this->_selection_changed_connection.disconnect(); //this->_selection_modified_connection.disconnect(); this->_mouseover_changed_connection.disconnect(); @@ -241,7 +238,6 @@ void NodeTool::setup() { ); this->helperpath_tmpitem = NULL; - this->helperpath_tmpitem_highlight = NULL; this->cursor_drag = false; this->show_transform_handles = true; this->single_node_transform_handles = false; @@ -285,10 +281,6 @@ void NodeTool::update_helperpath () { this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem); this->helperpath_tmpitem = NULL; } - if (this->helperpath_tmpitem_highlight) { - this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem_highlight); - this->helperpath_tmpitem_highlight = NULL; - } if (SP_IS_LPE_ITEM(selection->singleItem())) { Inkscape::LivePathEffect::Effect *lpe = SP_LPE_ITEM(selection->singleItem())->getCurrentLPE(); @@ -312,12 +304,7 @@ void NodeTool::update_helperpath () { cc->reset(); } if (!c->is_empty()) { - SPCanvasItem *helperpath_highlight = sp_canvas_bpath_new(this->desktop->getTempGroup(), c); - sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath_highlight), 0xffffff9A, 2.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); - sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath_highlight), 0, SP_WIND_RULE_NONZERO); - sp_canvas_item_affine_absolute(helperpath_highlight, selection->singleItem()->i2dt_affine()); - this->helperpath_tmpitem_highlight = this->desktop->add_temporary_canvasitem(helperpath_highlight, 0); - 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()); diff --git a/src/ui/tools/node-tool.h b/src/ui/tools/node-tool.h index bebb26dfc..8342d66a6 100644 --- a/src/ui/tools/node-tool.h +++ b/src/ui/tools/node-tool.h @@ -69,7 +69,6 @@ private: SPItem *flashed_item; Inkscape::Display::TemporaryItem *helperpath_tmpitem; - Inkscape::Display::TemporaryItem *helperpath_tmpitem_highlight; Inkscape::Display::TemporaryItem *flash_tempitem; Inkscape::UI::Selector* _selector; Inkscape::UI::PathSharedData* _path_data; diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index 49f28ad2c..b7579b1fb 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -865,7 +865,7 @@ void PenTool::_redrawAll() { 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); @@ -877,7 +877,7 @@ void PenTool::_redrawAll() { 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 @@ -1251,10 +1251,10 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { 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)); @@ -1277,7 +1277,7 @@ void PenTool::_setInitialPoint(Geom::Point const p) { 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); } @@ -1343,7 +1343,7 @@ void PenTool::_bsplineSpiroColor() 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); @@ -1701,7 +1701,7 @@ void PenTool::_bsplineSpiroBuild() }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); } @@ -1722,7 +1722,7 @@ void PenTool::_bsplineSpiroBuild() 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(); @@ -1778,7 +1778,7 @@ void PenTool::_setSubsequentPoint(Geom::Point const p, bool statusbar, guint sta } } - 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 ? @@ -1818,7 +1818,7 @@ void PenTool::_setCtrl(Geom::Point const p, guint const state) { 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]); @@ -1850,7 +1850,7 @@ void PenTool::_finishSegment(Geom::Point const p, guint const state) { 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); diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index 7cc695040..9e8005be8 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -847,7 +847,7 @@ void PencilTool::_fitAndSplit() { 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(); |
