summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2019-05-01 16:49:10 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-05-01 16:49:10 +0000
commitfcab6686f1afb40d13c9cabad26b992c4c800c07 (patch)
treee23f3fd92dc23d0f4c6452f0df59aa9beb51b5df /src
parentAllow LPE retain elements on convert to paths inside the original defs object (diff)
downloadinkscape-fcab6686f1afb40d13c9cabad26b992c4c800c07.tar.gz
inkscape-fcab6686f1afb40d13c9cabad26b992c4c800c07.zip
Good redraw of BPaths on trying to close a BSpline
Diffstat (limited to 'src')
-rw-r--r--src/ui/tools/pen-tool.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp
index 84933b929..8ba3a8d7b 100644
--- a/src/ui/tools/pen-tool.cpp
+++ b/src/ui/tools/pen-tool.cpp
@@ -1531,19 +1531,6 @@ void PenTool::_bsplineSpiroMotion(guint const state){
if (this->sa && this->green_curve->is_unset()) {
this->sa_overwrited = tmp_curve->copy();
}
- if (!this->green_bpaths.empty()) {
- this->green_curve = tmp_curve->copy();
- // remove old piecewise green canvasitems
- for (auto i: this->green_bpaths) {
- sp_canvas_item_destroy(i);
- }
- this->green_bpaths.clear();
- // one canvas bpath for all of 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.push_back(canvas_shape);
- }
}
if (cubic) {
if (this->bspline) {
@@ -1591,7 +1578,18 @@ void PenTool::_bsplineSpiroMotion(guint const state){
this->_bsplineSpiroEndAnchorOn();
}
}
-
+ if (!this->green_bpaths.empty()) {
+ // remove old piecewise green canvasitems
+ for (auto i: this->green_bpaths) {
+ sp_canvas_item_destroy(i);
+ }
+ this->green_bpaths.clear();
+ }
+ // one canvas bpath for all of 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.push_back(canvas_shape);
this->_bsplineSpiroBuild();
}