diff options
| author | Shlomi Fish <shlomif@shlomifish.org> | 2017-01-03 23:18:39 +0000 |
|---|---|---|
| committer | Shlomi Fish <shlomif@shlomifish.org> | 2017-01-03 23:18:39 +0000 |
| commit | 20124f96375afdfbf8ab58b6090db95ba0d2687b (patch) | |
| tree | 0f7e003dd9707b751c3b51e7b8133a21437ead95 /src | |
| parent | Merged. (diff) | |
| parent | Fix build on Windows (see http://inkscape.13.x6.nabble.com/compile-error-on-W... (diff) | |
| download | inkscape-20124f96375afdfbf8ab58b6090db95ba0d2687b.tar.gz inkscape-20124f96375afdfbf8ab58b6090db95ba0d2687b.zip | |
Merged.
(bzr r15369.1.5)
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/display/drawing-text.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-copy_rotate.cpp | 23 | ||||
| -rw-r--r-- | src/live_effects/lpe-copy_rotate.h | 1 |
4 files changed, 24 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1102bf4bf..47aa02ef1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -521,7 +521,6 @@ set(INKSCAPE_TARGET_LIBS depixelize_LIB util_LIB gc_LIB - ${INKSCAPE_LIBS} ) # Build everything except main and inkview.c in a shared library. @@ -534,7 +533,7 @@ if(WITH_DBUS) endif() # Link the inkscape_base library against all external dependencies -target_link_libraries(inkscape_base ${INKSCAPE_TARGET_LIBS}) +target_link_libraries(inkscape_base PRIVATE ${INKSCAPE_TARGET_LIBS} PUBLIC ${INKSCAPE_LIBS}) # Link inkscape and inkview against inkscape_base target_link_libraries(inkscape inkscape_base) diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp index 1280a2db9..21af7b200 100644 --- a/src/display/drawing-text.cpp +++ b/src/display/drawing-text.cpp @@ -599,7 +599,7 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are } { Inkscape::DrawingContext::Save save(dc); - if (!_style || ! _style->vector_effect.computed == SP_VECTOR_EFFECT_NON_SCALING_STROKE) { + if (!_style || !(_style->vector_effect.computed == SP_VECTOR_EFFECT_NON_SCALING_STROKE)) { dc.transform(_ctm); } if (has_stroke) { diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index c8f1b9e75..813f25d3d 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -15,6 +15,7 @@ #include <gdk/gdk.h> #include <2geom/path-intersection.h> #include <2geom/sbasis-to-bezier.h> +#include <2geom/intersection-graph.h> #include "live_effects/lpe-copy_rotate.h" // TODO due to internal breakage in glibmm headers, this must be last: #include <glibmm/i18n.h> @@ -45,7 +46,8 @@ LPECopyRotate::LPECopyRotate(LivePathEffectObject *lpeobject) : rotation_angle(_("Rotation angle"), _("Angle between two successive copies"), "rotation_angle", &wr, this, 60.0), num_copies(_("Number of copies"), _("Number of copies of the original path"), "num_copies", &wr, this, 6), copies_to_360(_("360º Copies"), _("No rotation angle, fixed to 360º"), "copies_to_360", &wr, this, true), - fuse_paths(_("Fuse paths"), _("Fuse paths by helper line, use fill-rule: evenodd for best result"), "fuse_paths", &wr, this, false), + fuse_paths(_("Kaleidoskope"), _("Kaleidoskope by helper line, use fill-rule: evenodd for best result"), "fuse_paths", &wr, this, false), + join_paths(_("Join paths"), _("Join paths, use fill-rule: evenodd for best result"), "join_paths", &wr, this, false), dist_angle_handle(100.0) { show_orig_path = true; @@ -53,6 +55,7 @@ LPECopyRotate::LPECopyRotate(LivePathEffectObject *lpeobject) : // register all your parameters here, so Inkscape knows which parameters this effect has: registerParameter(&copies_to_360); registerParameter(&fuse_paths); + registerParameter(&join_paths); registerParameter(&starting_angle); registerParameter(&starting_point); registerParameter(&rotation_angle); @@ -400,10 +403,26 @@ LPECopyRotate::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & p output = paths_to_pw(path_out); } } else { + Geom::PathVector output_pv = path_from_piecewise(output , 0.01); for (int i = 0; i < num_copies; ++i) { Rotate rot(-rad_from_deg(rotation_angle * i)); Affine t = pre * rot * Translate(origin); - output.concat(pwd2_in * t); + if (join_paths) { + Geom::PathVector join_pv = path_from_piecewise(pwd2_in * t , 0.01); + Geom::PathIntersectionGraph *pig = new Geom::PathIntersectionGraph(output_pv, join_pv); + if (pig) { + if (!output_pv.empty()) { + output_pv = pig->getUnion(); + } else { + output_pv = join_pv; + } + } + } else { + output.concat(pwd2_in * t); + } + } + if (join_paths) { + output = paths_to_pw(output_pv); } } return output; diff --git a/src/live_effects/lpe-copy_rotate.h b/src/live_effects/lpe-copy_rotate.h index 8f9fc12ac..c2ae2daf1 100644 --- a/src/live_effects/lpe-copy_rotate.h +++ b/src/live_effects/lpe-copy_rotate.h @@ -44,6 +44,7 @@ private: ScalarParam num_copies; BoolParam copies_to_360; BoolParam fuse_paths; + BoolParam join_paths; Geom::Point A; Geom::Point B; Geom::Point dir; |
