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 /src | |
| parent | Add new features to knot LPE (diff) | |
| download | inkscape-c980a179866f50f9f8dc3d69a50e25fdd7dba9a5.tar.gz inkscape-c980a179866f50f9f8dc3d69a50e25fdd7dba9a5.zip | |
Fixing coding style
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-knot.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index bf1a29e5b..0fd5af752 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -353,12 +353,10 @@ LPEKnot::LPEKnot(LivePathEffectObject *lpeobject) 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 @@ LPEKnot::doEffect_path (Geom::PathVector const &path_in) 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 @@ LPEKnot::doEffect_path (Geom::PathVector const &path_in) 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 @@ LPEKnot::doEffect_path (Geom::PathVector const &path_in) }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); } } } |
