summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-01 13:59:51 +0000
committerJabiertxof <jtx@jtx>2017-01-01 13:59:51 +0000
commit6d4adfb2fce437335a6c5226624a24c44164974d (patch)
tree087a8b83f59ca89a8ddd9d82b1da6749e7d4cef6 /src/live_effects
parentUpdate to trunk (diff)
parentFix bug/add feature on #1653380 on rotate copies (diff)
downloadinkscape-6d4adfb2fce437335a6c5226624a24c44164974d.tar.gz
inkscape-6d4adfb2fce437335a6c5226624a24c44164974d.zip
Update to trunk
(bzr r15295.1.40)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp25
-rw-r--r--src/live_effects/lpe-copy_rotate.h1
-rw-r--r--src/live_effects/lpe-gears.cpp2
-rw-r--r--src/live_effects/lpe-measure-line.cpp2
-rw-r--r--src/live_effects/lpe-measure-line.h3
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp20
-rw-r--r--src/live_effects/lpe-patternalongpath.cpp2
-rw-r--r--src/live_effects/lpe-perspective-envelope.cpp5
8 files changed, 50 insertions, 10 deletions
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index 3dd35696a..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);
@@ -259,7 +262,7 @@ LPECopyRotate::setFusion(Geom::PathVector &path_on, Geom::Path divider, double s
Geom::Point A = (Geom::Point)origin;
Geom::Point B = origin + dir * Geom::Rotate(-Geom::rad_from_deg((rotation_angle*i)+starting_angle)) * size_divider;
Geom::Line ls(A,B);
- Geom::Affine m = Geom::reflection (ls.vector(), A);
+ m = Geom::reflection (ls.vector(), A);
} else {
append_path = original;
}
@@ -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;
diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp
index 17579c64e..dad520041 100644
--- a/src/live_effects/lpe-gears.cpp
+++ b/src/live_effects/lpe-gears.cpp
@@ -207,7 +207,7 @@ LPEGears::LPEGears(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
teeth(_("_Teeth:"), _("The number of teeth"), "teeth", &wr, this, 10),
phi(_("_Phi:"), _("Tooth pressure angle (typically 20-25 deg). The ratio of teeth not in contact."), "phi", &wr, this, 5),
- min_radius(_("Min Radius:"), _("Minimun radius, low balues can slow"), "min_radius", &wr, this, 5.0)
+ min_radius(_("Min Radius:"), _("Minimum radius, low values can be slow"), "min_radius", &wr, this, 5.0)
{
/* Tooth pressure angle: The angle between the tooth profile and a perpendicular to the pitch
* circle, usually at the point where the pitch circle meets the tooth profile. Standard angles
diff --git a/src/live_effects/lpe-measure-line.cpp b/src/live_effects/lpe-measure-line.cpp
index df9a84bf8..e07335e1c 100644
--- a/src/live_effects/lpe-measure-line.cpp
+++ b/src/live_effects/lpe-measure-line.cpp
@@ -54,7 +54,7 @@ LPEMeasureLine::LPEMeasureLine(LivePathEffectObject *lpeobject) :
orientation(_("Orientation"), _("Orientation method"), "orientation", OMConverter, &wr, this, OM_PARALLEL, false),
curve_linked(_("Curve on origin"), _("Curve on origin, set 0 to start/end"), "curve_linked", &wr, this, 1),
precision(_("Precision*"), _("Precision"), "precision", &wr, this, 2),
- position(_("Positon*"), _("Positon"), "position", &wr, this, 5),
+ position(_("Position*"), _("Position"), "position", &wr, this, 5),
text_top_bottom(_("Text top/bottom*"), _("Text top/bottom"), "text_top_bottom", &wr, this, 0),
text_right_left(_("Text right/left*"), _("Text right/left"), "text_right_left", &wr, this, 0),
helpline_distance(_("Helpline distance*"), _("Helpline distance"), "helpline_distance", &wr, this, 0.0),
diff --git a/src/live_effects/lpe-measure-line.h b/src/live_effects/lpe-measure-line.h
index dea5ca47a..cb531affe 100644
--- a/src/live_effects/lpe-measure-line.h
+++ b/src/live_effects/lpe-measure-line.h
@@ -11,6 +11,9 @@
*/
#include "live_effects/effect.h"
+
+#include <gtkmm/expander.h>
+
#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/fontbutton.h"
#include "live_effects/parameter/text.h"
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index bca3d5cc0..f83025afc 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -190,9 +190,25 @@ LPEMirrorSymmetry::doBeforeEffect (SPLPEItem const* lpeitem)
}
if ( mode == MT_X || mode == MT_Y ) {
if (!are_near(previous_center, (Geom::Point)center_point, 0.01)) {
- start_point.param_setValue(point_a, true);
- end_point.param_setValue(point_b, true);
center_point.param_setValue(Geom::middle_point(point_a, point_b), true);
+ end_point.param_setValue(point_b, true);
+ start_point.param_setValue(point_a, true);
+ } else {
+ if ( mode == MT_X ) {
+ if (!are_near(start_point[X], point_a[X], 0.01)) {
+ start_point.param_setValue(point_a, true);
+ }
+ if (!are_near(end_point[X], point_b[X], 0.01)) {
+ end_point.param_setValue(point_b, true);
+ }
+ } else { //MT_Y
+ if (!are_near(start_point[Y], point_a[Y], 0.01)) {
+ start_point.param_setValue(point_a, true);
+ }
+ if (!are_near(end_point[Y], point_b[Y], 0.01)) {
+ end_point.param_setValue(point_b, true);
+ }
+ }
}
} else if ( mode == MT_FREE) {
if (are_near(previous_center, (Geom::Point)center_point, 0.01)) {
diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp
index e5c9f1be1..c1853ef22 100644
--- a/src/live_effects/lpe-patternalongpath.cpp
+++ b/src/live_effects/lpe-patternalongpath.cpp
@@ -63,7 +63,7 @@ static const Util::EnumDataConverter<PAPCopyType> PAPCopyTypeConverter(PAPCopyTy
LPEPatternAlongPath::LPEPatternAlongPath(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
pattern(_("Pattern source:"), _("Path to put along the skeleton path"), "pattern", &wr, this, "M0,0 L1,0"),
- original_height(0),
+ original_height(0.0),
prop_scale(_("_Width:"), _("Width of the pattern"), "prop_scale", &wr, this, 1.0),
copytype(_("Pattern copies:"), _("How many pattern copies to place along the skeleton path"),
"copytype", PAPCopyTypeConverter, &wr, this, PAPCT_SINGLE_STRETCHED),
diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp
index e834c0e86..e0dac0687 100644
--- a/src/live_effects/lpe-perspective-envelope.cpp
+++ b/src/live_effects/lpe-perspective-envelope.cpp
@@ -408,7 +408,8 @@ LPEPerspectiveEnvelope::newWidget()
vbox->pack_start(*hbox_middle, false, true, 2);
vbox->pack_start(*hbox_down_handles, true, true, 2);
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false,0));
- Gtk::Button* reset_button = Gtk::manage(new Gtk::Button(Gtk::Stock::CLEAR));
+ Gtk::Button* reset_button = Gtk::manage(new Gtk::Button(_("_Clear"), true));
+ reset_button->set_image_from_icon_name("edit-clear");
reset_button->signal_clicked().connect(sigc::mem_fun (*this,&LPEPerspectiveEnvelope::resetGrid));
reset_button->set_size_request(140,30);
vbox->pack_start(*hbox, true,true,2);
@@ -540,4 +541,4 @@ LPEPerspectiveEnvelope::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::v
fill-column:99
End:
*/
-// vim: file_type=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :