diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2018-10-24 18:02:00 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2018-10-25 07:48:24 +0000 |
| commit | a61d70d8ef1325f238d197b9e09858fc5f5e7684 (patch) | |
| tree | 3cae6df433b5ff39ecacd786b4502eeddce09646 | |
| parent | Fixing coding style (diff) | |
| download | inkscape-a61d70d8ef1325f238d197b9e09858fc5f5e7684.tar.gz inkscape-a61d70d8ef1325f238d197b9e09858fc5f5e7684.zip | |
Add fixes in review.
| -rw-r--r-- | clang_format_diff | 74 | ||||
| -rw-r--r-- | src/live_effects/lpe-knot.cpp | 4 | ||||
| -rw-r--r-- | src/object/sp-ellipse.cpp | 14 |
3 files changed, 8 insertions, 84 deletions
diff --git a/clang_format_diff b/clang_format_diff deleted file mode 100644 index 266bf79c9..000000000 --- a/clang_format_diff +++ /dev/null @@ -1,74 +0,0 @@ ---- src/live_effects/lpe-knot.cpp (before formatting) -+++ src/live_effects/lpe-knot.cpp (after formatting) -@@ -353,12 +353,10 @@ - 3) - , prop_to_stroke_width(_("_In units of stroke width"), _("Consider 'Width' as a ratio of stroke width"), - "prop_to_stroke_width", &wr, this, true) -- , both(_("_Both gaps"), _("Use gap in both intersection elements"), -- "both", &wr, this, false) -+ , both(_("_Both gaps"), _("Use gap in both intersection elements"), "both", &wr, this, false) - , inverse_width(_("_Groups: Inverse"), _("Use other stroke width, useful in groups with diferent stroke width"), - "inverse_width", &wr, this, false) -- , unclimb(_("_Groups: unclimb"), _("Don`t climb the gap in the same path"), -- "unclimb", &wr, this, false) -+ , unclimb(_("_Groups: unclimb"), _("Don`t climb the gap in the same path"), "unclimb", &wr, this, false) - , add_stroke_width("St_roke width", "Add the stroke width to the interruption size", "add_stroke_width", &wr, this, - "inkscape_1.0_and_up", true) - , add_other_stroke_width("_Crossing path stroke width", "Add crossed stroke width to the interruption size", -@@ -452,7 +450,7 @@ - - int geom_sign = ( cross(flag_i[1], flag_j[1]) < 0 ? 1 : -1); - if (unclimb) { -- geom_sign = comp%2 == 0 ? -1 : -1; -+ geom_sign = comp % 2 == 0 ? -1 : -1; - } - bool i0_is_under = false; - double width = interruption_width; -@@ -464,11 +462,11 @@ - i0_is_under = true; - } - } -- i0_is_under = crossing_points[p].sign != 0 && both?true:i0_is_under; -- if (i0_is_under && j == i0){ -- std::swap( i, j); -+ i0_is_under = crossing_points[p].sign != 0 && both ? true : i0_is_under; -+ if (i0_is_under && j == i0) { -+ std::swap(i, j); - std::swap(ti, tj); -- std::swap(flag_i,flag_j); -+ std::swap(flag_i, flag_j); - } - if (i0_is_under){ - if ( prop_to_stroke_width.get_value() ) { -@@ -494,19 +492,18 @@ - }else{ - dom = complementOf(hidden,dom); - } -- if (crossing_points[p].i == i0 && -- crossing_points[p].j == i0 && -- crossing_points[p].sign != 0 && -- both) -- { -- hidden = findShadowedTime(gpaths[i0], flag_i, tj, width/2); -- period = size_nondegenerate(gpaths[i0]); -- if (hidden.max() > period ) hidden -= period; -- if (hidden.min()<0){ -- dom = complementOf( Interval(0,hidden.max()) ,dom); -- dom = complementOf( Interval(hidden.min()+period, period) ,dom); -- }else{ -- dom = complementOf(hidden,dom); -+ if (crossing_points[p].i == i0 && crossing_points[p].j == i0 && crossing_points[p].sign != 0 && -+ both) { -+ hidden = findShadowedTime(gpaths[i0], flag_i, tj, width / 2); -+ period = size_nondegenerate(gpaths[i0]); -+ if (hidden.max() > period) -+ hidden -= period; -+ if (hidden.min() < 0) { -+ dom = complementOf(Interval(0, hidden.max()), dom); -+ dom = complementOf(Interval(hidden.min() + period, period), dom); -+ } -+ else { -+ dom = complementOf(hidden, dom); - } - } - } diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index 0fd5af752..051018c43 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -418,7 +418,7 @@ LPEKnot::doEffect_path (Geom::PathVector const &path_in) unsigned i0 = 0; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gint precision = prefs->getInt("/options/svgoutput/numericprecision"); - prefs->setInt("/options/svgoutput/numericprecision", 4); // thinc is enogught to minor diferences + prefs->setInt("/options/svgoutput/numericprecision", 4); // I think this is enough for minor differences for (i0=0; i0<gpaths.size(); i0++){ if (!strcmp(sp_svg_write_path(original_pathv[comp]), sp_svg_write_path(gpaths[i0]))) break; @@ -660,7 +660,7 @@ void LPEKnot::addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) { KnotHolderEntity *e = new KnotHolderEntityCrossingSwitcher(this); e->create(nullptr, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, - _("Drag to select a crossing, click to flip it, CTRL + click to update all crossings")); + _("Drag to select a crossing, click to flip it, Ctrl + click to update all crossings")); knotholder->add(e); }; diff --git a/src/object/sp-ellipse.cpp b/src/object/sp-ellipse.cpp index 0623fbf0c..23736b786 100644 --- a/src/object/sp-ellipse.cpp +++ b/src/object/sp-ellipse.cpp @@ -461,14 +461,12 @@ void SPGenericEllipse::set_shape() if (this->_isSlice() && this->arc_type == SP_GENERIC_ELLIPSE_ARC_TYPE_SLICE) { pb.lineTo(Geom::Point(0, 0)); } - // If convert to paths ellipses become unclosed so comment this and call "closePath" - // Remove later - // if ( !(this->arc_type == SP_GENERIC_ELLIPSE_ARC_TYPE_ARC) ) { - // pb.closePath(); - // } else { - // pb.flush(); - // } - pb.closePath(); + + if ( !(this->arc_type == SP_GENERIC_ELLIPSE_ARC_TYPE_ARC) ) { + pb.closePath(); + } else { + pb.flush(); + } c = new SPCurve(pb.peek()); // gchar *str = sp_svg_write_path(curve->get_pathvector()); |
