diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2018-10-24 17:38:04 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2018-10-25 07:48:24 +0000 |
| commit | c980a179866f50f9f8dc3d69a50e25fdd7dba9a5 (patch) | |
| tree | 15415d0936d0f3f0afa0d1b2b96f32de4c5c30f2 /clang_format_diff | |
| parent | Add new features to knot LPE (diff) | |
| download | inkscape-c980a179866f50f9f8dc3d69a50e25fdd7dba9a5.tar.gz inkscape-c980a179866f50f9f8dc3d69a50e25fdd7dba9a5.zip | |
Fixing coding style
Diffstat (limited to 'clang_format_diff')
| -rw-r--r-- | clang_format_diff | 104 |
1 files changed, 71 insertions, 33 deletions
diff --git a/clang_format_diff b/clang_format_diff index 695f5d503..266bf79c9 100644 --- a/clang_format_diff +++ b/clang_format_diff @@ -1,36 +1,74 @@ ---- src/object/sp-ellipse.cpp (before formatting) -+++ src/object/sp-ellipse.cpp (after formatting) -@@ -461,13 +461,13 @@ - 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(); --// } -+ // 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(); - c = new SPCurve(pb.peek()); - --- src/live_effects/lpe-knot.cpp (before formatting) +++ src/live_effects/lpe-knot.cpp (after formatting) -@@ -50,8 +50,8 @@ +@@ -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 @@ - static Geom::Path::size_type size_nondegenerate(Geom::Path const &path) { - Geom::Path::size_type retval = path.size_default(); -- const Geom::Curve &closingline = path.back_closed(); -- // the closing line segment is always of type -+ const Geom::Curve &closingline = path.back_closed(); -+ // the closing line segment is always of type - // Geom::LineSegment. - if (are_near(closingline.initialPoint(), closingline.finalPoint())) { - // closingline.isDegenerate() did not work, because it only checks for + 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); + } + } + } |
