summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-06-07 11:43:05 +0000
committerNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-07-06 00:28:42 +0000
commitdc0366de59e6d9c0bbbeab324e1bddf1ad721fae (patch)
treef5b3d100e4935e0822415bbb5f55d757f651975b
parentFix coding style (diff)
downloadinkscape-dc0366de59e6d9c0bbbeab324e1bddf1ad721fae.tar.gz
inkscape-dc0366de59e6d9c0bbbeab324e1bddf1ad721fae.zip
Display spiro pen preview right after backspace
Fix https://gitlab.com/inkscape/inkscape/issues/282
-rw-r--r--src/ui/tools/pen-tool.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp
index 9bcef5fc8..c431806b5 100644
--- a/src/ui/tools/pen-tool.cpp
+++ b/src/ui/tools/pen-tool.cpp
@@ -1904,11 +1904,6 @@ bool PenTool::_undoLastPoint() {
} else {
// Reset red curve
this->red_curve->reset();
- // Destroy topmost green bpath
- if (!this->green_bpaths.empty()) {
- sp_canvas_item_destroy(this->green_bpaths.back());
- this->green_bpaths.pop_back();
- }
// Get last segment
if ( this->green_curve->is_unset() ) {
g_warning("pen_handle_key_press, case GDK_KP_Delete: Green curve is empty");
@@ -1932,7 +1927,7 @@ bool PenTool::_undoLastPoint() {
Geom::Point const pt( (this->npoints < 4) ? crv->finalPoint() : this->p[3] );
this->npoints = 2;
- // delete the last segment of the green curve
+ // delete the last segment of the green curve and green bpath
if (this->green_curve->get_segment_count() == 1) {
this->npoints = 5;
if (!this->green_bpaths.empty()) {
@@ -1942,6 +1937,12 @@ bool PenTool::_undoLastPoint() {
this->green_curve->reset();
} else {
this->green_curve->backspace();
+ if (this->green_bpaths.size() > 1) {
+ sp_canvas_item_destroy(this->green_bpaths.back());
+ this->green_bpaths.pop_back();
+ } else if (this->green_bpaths.size() == 1) {
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(green_bpaths.back()), this->green_curve, true);
+ }
}
// assign the value of this->p[1] to the opposite of the green line last segment