From 4b8c6b64ba7ac54955cc68aa6ad18c67b57ef5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Sun, 9 Mar 2014 23:20:18 -0300 Subject: Removing repeated condition logical test to make the code more readable and easier to follow. (bzr r11950.6.2) --- src/ui/tools/freehand-base.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/ui/tools/freehand-base.cpp') diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 4b7a310e3..3f74a5147 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -540,6 +540,11 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) if(Geom::are_near(dc->sa->curve->first_path()->initialPoint(), dc->ea->dp)){ dc->sa->curve->closepath_current(); } + + // if the curve has an bspline or spiro LPE, we execute + // spdc_flush_white, passing the necessary starting curve. + dc->white_curves = g_slist_remove(dc->white_curves, dc->sa->curve); + spdc_flush_white(dc, dc->sa->curve); }else{ if (dc->sa->start && !(dc->sa->curve->is_closed()) ) { c = reverse_then_unref(c); @@ -547,16 +552,9 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) dc->sa->curve->append_continuous(c, 0.0625); c->unref(); dc->sa->curve->closepath_current(); - } - - //if the curve has an bspline or spiro LPE, we execute spdc_flush_white, passing the necessary starting curve. - if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1 || - prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2){ - dc->white_curves = g_slist_remove(dc->white_curves, dc->sa->curve); - spdc_flush_white(dc, dc->sa->curve); - }else{ spdc_flush_white(dc, NULL); } + return; } -- cgit v1.2.3