summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-06-01 21:47:04 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-06-01 21:47:04 +0000
commit6c85e7bc3b136ad5f831a4c289e04fdbe7451297 (patch)
treea026eaf58deb09da7b04db6a266dfb7516f21c9a /src/live_effects
parentopening kaleidscope (diff)
parentMark user-visible messages for translation (diff)
downloadinkscape-6c85e7bc3b136ad5f831a4c289e04fdbe7451297.tar.gz
inkscape-6c85e7bc3b136ad5f831a4c289e04fdbe7451297.zip
update to trunk
(bzr r13708.1.29)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/effect.cpp3
-rw-r--r--src/live_effects/effect.h1
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp7
-rw-r--r--src/live_effects/lpe-fillet-chamfer.h9
-rw-r--r--src/live_effects/lpe-gears.cpp2
-rw-r--r--src/live_effects/lpe-jointype.cpp1
-rw-r--r--src/live_effects/lpe-knot.cpp6
-rw-r--r--src/live_effects/lpe-lattice2.cpp2
-rw-r--r--src/live_effects/lpe-lattice2.h6
-rw-r--r--src/live_effects/lpe-perspective-envelope.cpp64
-rw-r--r--src/live_effects/lpe-perspective-envelope.h6
-rw-r--r--src/live_effects/lpe-roughen.cpp22
-rw-r--r--src/live_effects/lpe-roughen.h2
-rw-r--r--src/live_effects/lpe-taperstroke.cpp9
-rw-r--r--src/live_effects/parameter/filletchamferpointarray.cpp13
-rw-r--r--src/live_effects/parameter/filletchamferpointarray.h4
-rw-r--r--src/live_effects/parameter/originalpath.cpp4
-rw-r--r--src/live_effects/parameter/originalpatharray.cpp4
-rw-r--r--src/live_effects/parameter/parameter.cpp7
-rw-r--r--src/live_effects/parameter/parameter.h7
-rw-r--r--src/live_effects/parameter/path.cpp8
21 files changed, 103 insertions, 84 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index b09e09e62..f65e8f289 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -365,7 +365,6 @@ Effect::Effect(LivePathEffectObject *lpeobject)
lpeobj(lpeobject),
concatenate_before_pwd2(false),
sp_lpe_item(NULL),
- defaultUnit("px"),
current_zoom(1),
sp_curve(NULL),
provides_own_flash_paths(true), // is automatically set to false if providesOwnFlashPaths() is not overridden
@@ -455,7 +454,6 @@ void Effect::doOnRemove (SPLPEItem const* /*lpeitem*/)
void Effect::doOnApply_impl(SPLPEItem const* lpeitem)
{
sp_lpe_item = const_cast<SPLPEItem *>(lpeitem);
- defaultUnit = sp_lpe_item->document->getDisplayUnit()->abbr;
/*sp_curve = SP_SHAPE(sp_lpe_item)->getCurve();
pathvector_before_effect = sp_curve->get_pathvector();*/
doOnApply(lpeitem);
@@ -464,7 +462,6 @@ void Effect::doOnApply_impl(SPLPEItem const* lpeitem)
void Effect::doBeforeEffect_impl(SPLPEItem const* lpeitem)
{
sp_lpe_item = const_cast<SPLPEItem *>(lpeitem);
- defaultUnit = sp_lpe_item->document->getDisplayUnit()->abbr;
//printf("(SPLPEITEM*) %p\n", sp_lpe_item);
SPShape * shape = dynamic_cast<SPShape *>(sp_lpe_item);
if(shape){
diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h
index ac1f0b8dc..a6b5a13ea 100644
--- a/src/live_effects/effect.h
+++ b/src/live_effects/effect.h
@@ -159,7 +159,6 @@ protected:
bool concatenate_before_pwd2;
SPLPEItem * sp_lpe_item; // these get stored in doBeforeEffect_impl, and derived classes may do as they please with them.
- Glib::ustring defaultUnit; // these get stored in doBeforeEffect_impl, and derived classes may do as they please with them.
double current_zoom;
std::vector<Geom::Point> selectedNodesPoints;
SPCurve * sp_curve;
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index c8458b8cb..ca87c7be1 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -29,7 +29,6 @@
// for programmatically updating knots
#include "ui/tools-switch.h"
-#include <util/units.h>
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
@@ -57,7 +56,6 @@ LPEFilletChamfer::LPEFilletChamfer(LivePathEffectObject *lpeobject) :
only_selected(_("Change only selected nodes"), _("Change only selected nodes"), "only_selected", &wr, this, false),
flexible(_("Flexible radius size (%)"), _("Flexible radius size (%)"), "flexible", &wr, this, false),
use_knot_distance(_("Use knots distance instead radius"), _("Use knots distance instead radius"), "use_knot_distance", &wr, this, false),
- unit(_("Unit:"), _("Unit"), "unit", &wr, this),
method(_("Method:"), _("Fillets methods"), "method", FMConverter, &wr, this, FM_AUTO),
radius(_("Radius (unit or %):"), _("Radius, in unit or %"), "radius", &wr, this, 0.),
chamfer_steps(_("Chamfer steps:"), _("Chamfer steps"), "chamfer_steps", &wr, this, 0),
@@ -65,7 +63,6 @@ LPEFilletChamfer::LPEFilletChamfer(LivePathEffectObject *lpeobject) :
helper_size(_("Helper size with direction:"), _("Helper size with direction"), "helper_size", &wr, this, 0)
{
registerParameter(&fillet_chamfer_values);
- registerParameter(&unit);
registerParameter(&method);
registerParameter(&radius);
registerParameter(&chamfer_steps);
@@ -223,7 +220,7 @@ void LPEFilletChamfer::updateFillet()
{
double power = 0;
if (!flexible) {
- power = Inkscape::Util::Quantity::convert(radius, unit.get_abbreviation(), defaultUnit) * -1;
+ power = radius * -1;
} else {
power = radius;
}
@@ -444,9 +441,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
} else {
fillet_chamfer_values.set_helper_size(helper_size);
}
- fillet_chamfer_values.set_document_unit(defaultUnit);
fillet_chamfer_values.set_use_distance(use_knot_distance);
- fillet_chamfer_values.set_unit(unit.get_abbreviation());
SPCurve *c = SP_IS_PATH(lpeItem) ? static_cast<SPPath const *>(lpeItem)
->get_original_curve()
: SP_SHAPE(lpeItem)->getCurve();
diff --git a/src/live_effects/lpe-fillet-chamfer.h b/src/live_effects/lpe-fillet-chamfer.h
index 0d6a1ff17..f8e03a399 100644
--- a/src/live_effects/lpe-fillet-chamfer.h
+++ b/src/live_effects/lpe-fillet-chamfer.h
@@ -15,14 +15,6 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#if defined(GLIBMM_DISABLE_DEPRECATED) && defined(HAVE_GLIBMM_THREADS_H)
-# include <glibmm/threads.h>
-#endif
-
#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/bool.h"
#include "live_effects/parameter/unit.h"
@@ -74,7 +66,6 @@ private:
BoolParam only_selected;
BoolParam flexible;
BoolParam use_knot_distance;
- UnitParam unit;
EnumParam<FilletMethod> method;
ScalarParam radius;
ScalarParam chamfer_steps;
diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp
index 003e22567..fafe143b5 100644
--- a/src/live_effects/lpe-gears.cpp
+++ b/src/live_effects/lpe-gears.cpp
@@ -168,7 +168,7 @@ Geom::Path Gear::path() {
D2<SBasis> root = _arc(cursor, cursor+root_advance, root_radius());
makeContinuous(root, prev);
pb.append(SBasisCurve(root));
- cursor += root_advance;
+ //cursor += root_advance;
prev = root.at1();
if (base_radius() > root_radius()) {
diff --git a/src/live_effects/lpe-jointype.cpp b/src/live_effects/lpe-jointype.cpp
index 0111a0f99..c6a08d336 100644
--- a/src/live_effects/lpe-jointype.cpp
+++ b/src/live_effects/lpe-jointype.cpp
@@ -110,6 +110,7 @@ void LPEJoinType::doOnApply(SPLPEItem const* lpeitem)
sp_repr_css_attr_unref (css);
line_width.param_set_value(width);
+ line_width.write_to_SVG();
}
}
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index 820221abf..ec2f9c419 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -505,9 +505,9 @@ LPEKnot::doEffect_path (std::vector<Geom::Path> const &path_in)
static void
collectPathsAndWidths (SPLPEItem const *lpeitem, std::vector<Geom::Path> &paths, std::vector<double> &stroke_widths){
if (SP_IS_GROUP(lpeitem)) {
- GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem));
- for ( GSList const *iter = item_list; iter; iter = iter->next ) {
- SPObject *subitem = static_cast<SPObject *>(iter->data);
+ std::vector<SPItem*> item_list = sp_item_group_item_list(SP_GROUP(lpeitem));
+ for ( std::vector<SPItem*>::const_iterator iter = item_list.begin(); iter != item_list.end(); iter++) {
+ SPObject *subitem = *iter;
if (SP_IS_LPE_ITEM(subitem)) {
collectPathsAndWidths(SP_LPE_ITEM(subitem), paths, stroke_widths);
}
diff --git a/src/live_effects/lpe-lattice2.cpp b/src/live_effects/lpe-lattice2.cpp
index abd6e7786..02bda3af5 100644
--- a/src/live_effects/lpe-lattice2.cpp
+++ b/src/live_effects/lpe-lattice2.cpp
@@ -18,6 +18,8 @@
#include "live_effects/lpe-lattice2.h"
+#include <gtkmm/expander.h>
+
#include "sp-shape.h"
#include "sp-item.h"
#include "sp-path.h"
diff --git a/src/live_effects/lpe-lattice2.h b/src/live_effects/lpe-lattice2.h
index ff2e75641..b32903c9e 100644
--- a/src/live_effects/lpe-lattice2.h
+++ b/src/live_effects/lpe-lattice2.h
@@ -18,12 +18,16 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
#include "live_effects/parameter/enum.h"
+#include <gtkmm/widget.h>
#include "live_effects/effect.h"
#include "live_effects/parameter/point.h"
#include "live_effects/lpegroupbbox.h"
+namespace Gtk {
+class Expander;
+}
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp
index 4eac2d6eb..08100bb2d 100644
--- a/src/live_effects/lpe-perspective-envelope.cpp
+++ b/src/live_effects/lpe-perspective-envelope.cpp
@@ -40,7 +40,8 @@ static const Util::EnumDataConverter<unsigned> DeformationTypeConverter(Deformat
LPEPerspectiveEnvelope::LPEPerspectiveEnvelope(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
- // initialise your parameters here:
+ horizontal_mirror(_("Mirror movements in horizontal"), _("Mirror movements in horizontal"), "horizontal_mirror", &wr, this, false),
+ vertical_mirror(_("Mirror movements in vertical"), _("Mirror movements in vertical"), "vertical_mirror", &wr, this, false),
deform_type(_("Type"), _("Select the type of deformation"), "deform_type", DeformationTypeConverter, &wr, this, DEFORMATION_PERSPECTIVE),
up_left_point(_("Top Left"), _("Top Left - <b>Ctrl+Alt+Click</b>: reset, <b>Ctrl</b>: move along axes"), "up_left_point", &wr, this),
up_right_point(_("Top Right"), _("Top Right - <b>Ctrl+Alt+Click</b>: reset, <b>Ctrl</b>: move along axes"), "up_right_point", &wr, this),
@@ -49,6 +50,8 @@ LPEPerspectiveEnvelope::LPEPerspectiveEnvelope(LivePathEffectObject *lpeobject)
{
// register all your parameters here, so Inkscape knows which parameters this effect has:
registerParameter(&deform_type);
+ registerParameter(&horizontal_mirror);
+ registerParameter(&vertical_mirror);
registerParameter(&up_left_point);
registerParameter(&up_right_point);
registerParameter(&down_left_point);
@@ -63,6 +66,13 @@ void LPEPerspectiveEnvelope::doEffect(SPCurve *curve)
{
using Geom::X;
using Geom::Y;
+ if(are_near(up_left_point, up_right_point) &&
+ are_near(up_right_point, down_left_point) &&
+ are_near(down_left_point, down_right_point)) {
+ g_warning("Perspective/Envelope LPE::doBeforeEffect - lpeobj with invalid parameter, the same value in 4 handles!");
+ resetGrid();
+ return;
+ }
double projmatrix[3][3];
if(deform_type == DEFORMATION_PERSPECTIVE) {
std::vector<Geom::Point> handles(4);
@@ -306,9 +316,61 @@ LPEPerspectiveEnvelope::newWidget()
}
void
+LPEPerspectiveEnvelope::vertical(PointParam &param_one, PointParam &param_two, Geom::Line vert)
+{
+ Geom::Point A = param_one;
+ Geom::Point B = param_two;
+ double Y = (A[Geom::Y] + B[Geom::Y])/2;
+ A[Geom::Y] = Y;
+ B[Geom::Y] = Y;
+ Geom::Point nearest = vert.pointAt(vert.nearestPoint(A));
+ double distance_one = Geom::distance(A,nearest);
+ double distance_two = Geom::distance(B,nearest);
+ double distance_middle = (distance_one + distance_two)/2;
+ if(A[Geom::X] > B[Geom::X]) {
+ distance_middle *= -1;
+ }
+ A[Geom::X] = nearest[Geom::X] - distance_middle;
+ B[Geom::X] = nearest[Geom::X] + distance_middle;
+ param_one.param_setValue(A, true);
+ param_two.param_setValue(B, true);
+}
+
+void
+LPEPerspectiveEnvelope::horizontal(PointParam &param_one, PointParam &param_two, Geom::Line horiz)
+{
+ Geom::Point A = param_one;
+ Geom::Point B = param_two;
+ double X = (A[Geom::X] + B[Geom::X])/2;
+ A[Geom::X] = X;
+ B[Geom::X] = X;
+ Geom::Point nearest = horiz.pointAt(horiz.nearestPoint(A));
+ double distance_one = Geom::distance(A,nearest);
+ double distance_two = Geom::distance(B,nearest);
+ double distance_middle = (distance_one + distance_two)/2;
+ if(A[Geom::Y] > B[Geom::Y]) {
+ distance_middle *= -1;
+ }
+ A[Geom::Y] = nearest[Geom::Y] - distance_middle;
+ B[Geom::Y] = nearest[Geom::Y] + distance_middle;
+ param_one.param_setValue(A, true);
+ param_two.param_setValue(B, true);
+}
+
+void
LPEPerspectiveEnvelope::doBeforeEffect (SPLPEItem const* lpeitem)
{
original_bbox(lpeitem);
+ Geom::Line vert(Geom::Point(boundingbox_X.middle(),boundingbox_Y.max()), Geom::Point(boundingbox_X.middle(), boundingbox_Y.min()));
+ Geom::Line horiz(Geom::Point(boundingbox_X.min(),boundingbox_Y.middle()), Geom::Point(boundingbox_X.max(), boundingbox_Y.middle()));
+ if(vertical_mirror) {
+ vertical(up_left_point, up_right_point,vert);
+ vertical(down_left_point, down_right_point,vert);
+ }
+ if(horizontal_mirror) {
+ horizontal(up_left_point, down_left_point,horiz);
+ horizontal(up_right_point, down_right_point,horiz);
+ }
SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem);
item->apply_to_clippath(item);
item->apply_to_mask(item);
diff --git a/src/live_effects/lpe-perspective-envelope.h b/src/live_effects/lpe-perspective-envelope.h
index e25f059a3..dd14dc212 100644
--- a/src/live_effects/lpe-perspective-envelope.h
+++ b/src/live_effects/lpe-perspective-envelope.h
@@ -42,6 +42,10 @@ public:
virtual void resetDefaults(SPItem const* item);
+ virtual void vertical(PointParam &paramA,PointParam &paramB, Geom::Line vert);
+
+ virtual void horizontal(PointParam &paramA,PointParam &paramB,Geom::Line horiz);
+
virtual void doBeforeEffect(SPLPEItem const* lpeitem);
virtual Gtk::Widget * newWidget();
@@ -54,6 +58,8 @@ protected:
void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec);
private:
+ BoolParam horizontal_mirror;
+ BoolParam vertical_mirror;
EnumParam<unsigned> deform_type;
PointParam up_left_point;
PointParam up_right_point;
diff --git a/src/live_effects/lpe-roughen.cpp b/src/live_effects/lpe-roughen.cpp
index 9d1c3152b..c5e002351 100644
--- a/src/live_effects/lpe-roughen.cpp
+++ b/src/live_effects/lpe-roughen.cpp
@@ -20,7 +20,6 @@
#include "live_effects/parameter/parameter.h"
#include "helper/geom.h"
#include <glibmm/i18n.h>
-#include <util/units.h>
#include <cmath>
namespace Inkscape {
@@ -36,7 +35,6 @@ DMConverter(DivisionMethodData, DM_END);
LPERoughen::LPERoughen(LivePathEffectObject *lpeobject)
: Effect(lpeobject),
// initialise your parameters here:
- unit(_("Unit"), _("Unit"), "unit", &wr, this),
method(_("Method"), _("Division method"), "method", DMConverter, &wr,
this, DM_SEGMENTS),
max_segment_size(_("Max. segment size"), _("Max. segment size"),
@@ -54,7 +52,6 @@ LPERoughen::LPERoughen(LivePathEffectObject *lpeobject)
shift_node_handles(_("Shift node handles"), _("Shift node handles"),
"shift_node_handles", &wr, this, true)
{
- registerParameter(&unit);
registerParameter(&method);
registerParameter(&max_segment_size);
registerParameter(&segments);
@@ -98,14 +95,6 @@ Gtk::Widget *LPERoughen::newWidget()
if ((*it)->widget_is_visible) {
Parameter *param = *it;
Gtk::Widget *widg = dynamic_cast<Gtk::Widget *>(param->param_newWidget());
- if (param->param_key == "unit") {
- Gtk::Label *unit_label = Gtk::manage(new Gtk::Label(
- Glib::ustring(_("<b>Roughen unit</b>")), Gtk::ALIGN_START));
- unit_label->set_use_markup(true);
- vbox->pack_start(*unit_label, false, false, 2);
- vbox->pack_start(*Gtk::manage(new Gtk::HSeparator()),
- Gtk::PACK_EXPAND_WIDGET);
- }
if (param->param_key == "method") {
Gtk::Label *method_label = Gtk::manage(new Gtk::Label(
Glib::ustring(_("<b>Add nodes</b> Subdivide each segment")),
@@ -160,11 +149,8 @@ double LPERoughen::sign(double random_number)
Geom::Point LPERoughen::randomize()
{
- Inkscape::Util::Unit const *svg_units = SP_ACTIVE_DESKTOP->namedview->svg_units;
- double displace_x_parsed = Inkscape::Util::Quantity::convert(
- displace_x * global_randomize, unit.get_abbreviation(), svg_units->abbr);
- double displace_y_parsed = Inkscape::Util::Quantity::convert(
- displace_y * global_randomize, unit.get_abbreviation(), svg_units->abbr);
+ double displace_x_parsed = displace_x * global_randomize;
+ double displace_y_parsed = displace_y * global_randomize;
Geom::Point output = Geom::Point(sign(displace_x_parsed), sign(displace_y_parsed));
return output;
@@ -175,7 +161,6 @@ void LPERoughen::doEffect(SPCurve *curve)
Geom::PathVector const original_pathv =
pathv_to_linear_and_cubic_beziers(curve->get_pathvector());
curve->reset();
- Inkscape::Util::Unit const *svg_units = SP_ACTIVE_DESKTOP->namedview->svg_units;
for (Geom::PathVector::const_iterator path_it = original_pathv.begin();
path_it != original_pathv.end(); ++path_it) {
if (path_it->empty())
@@ -220,8 +205,7 @@ void LPERoughen::doEffect(SPCurve *curve)
} else {
nCurve->lineto(point3);
}
- double length = Inkscape::Util::Quantity::convert(
- curve_it1->length(0.001), svg_units->abbr, unit.get_abbreviation());
+ double length = curve_it1->length(0.001);
std::size_t splits = 0;
if (method == DM_SEGMENTS) {
splits = segments;
diff --git a/src/live_effects/lpe-roughen.h b/src/live_effects/lpe-roughen.h
index ed9f06cf7..2b285cd40 100644
--- a/src/live_effects/lpe-roughen.h
+++ b/src/live_effects/lpe-roughen.h
@@ -17,7 +17,6 @@
#include "live_effects/parameter/parameter.h"
#include "live_effects/parameter/path.h"
#include "live_effects/parameter/bool.h"
-#include "live_effects/parameter/unit.h"
#include "live_effects/parameter/random.h"
namespace Inkscape {
@@ -45,7 +44,6 @@ public:
virtual Gtk::Widget *newWidget();
private:
- UnitParam unit;
EnumParam<DivisionMethod> method;
ScalarParam max_segment_size;
ScalarParam segments;
diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp
index 2c74af6d6..5765febbd 100644
--- a/src/live_effects/lpe-taperstroke.cpp
+++ b/src/live_effects/lpe-taperstroke.cpp
@@ -126,6 +126,7 @@ void LPETaperStroke::doOnApply(SPLPEItem const* lpeitem)
sp_repr_css_attr_unref (css);
line_width.param_set_value(width);
+ line_width.write_to_SVG();
} else {
printf("WARNING: It only makes sense to apply Taper stroke to paths (not groups).\n");
}
@@ -275,7 +276,7 @@ Geom::PathVector LPETaperStroke::doEffect_path(Geom::PathVector const& path_in)
pat_str << "M 1,0 C " << 1 - (double)smoothing << ",0 0,0.5 0,0.5 0,0.5 " << 1 - (double)smoothing << ",1 1,1";
pat_vec = sp_svg_read_pathv(pat_str.str().c_str());
- pwd2.concat(stretch_along(pathv_out[0].toPwSb(), pat_vec[0], -fabs(line_width)));
+ pwd2.concat(stretch_along(pathv_out[0].toPwSb(), pat_vec[0], fabs(line_width)));
throwaway_path = Geom::path_from_piecewise(pwd2, LPE_CONVERSION_TOLERANCE)[0];
real_path.append(throwaway_path);
@@ -304,7 +305,7 @@ Geom::PathVector LPETaperStroke::doEffect_path(Geom::PathVector const& path_in)
pat_vec = sp_svg_read_pathv(pat_str_1.str().c_str());
pwd2 = Piecewise<D2<SBasis> >();
- pwd2.concat(stretch_along(pathv_out[2].toPwSb(), pat_vec[0], -fabs(line_width)));
+ pwd2.concat(stretch_along(pathv_out[2].toPwSb(), pat_vec[0], fabs(line_width)));
throwaway_path = Geom::path_from_piecewise(pwd2, LPE_CONVERSION_TOLERANCE)[0];
if (!Geom::are_near(real_path.finalPoint(), throwaway_path.initialPoint()) && real_path.size() >= 1) {
@@ -389,13 +390,9 @@ Piecewise<D2<SBasis> > stretch_along(Piecewise<D2<SBasis> > pwd2_in, Geom::Path
x0 -= pattBndsX->min();
y0 -= pattBndsY->middle();
- double xspace = 0;
double noffset = 0;
double toffset = 0;
// Prevent more than 90% overlap...
- if (xspace < -pattBndsX->extent()*.9) {
- xspace = -pattBndsX->extent()*.9;
- }
y0+=noffset;
diff --git a/src/live_effects/parameter/filletchamferpointarray.cpp b/src/live_effects/parameter/filletchamferpointarray.cpp
index e9d375b93..10ded4d9f 100644
--- a/src/live_effects/parameter/filletchamferpointarray.cpp
+++ b/src/live_effects/parameter/filletchamferpointarray.cpp
@@ -354,11 +354,6 @@ void FilletChamferPointArrayParam::set_pwd2(
last_pwd2_normal = pwd2_normal_in;
}
-void FilletChamferPointArrayParam::set_document_unit(Glib::ustring value_document_unit)
-{
- documentUnit = value_document_unit;
-}
-
void FilletChamferPointArrayParam::set_helper_size(int hs)
{
helper_size = hs;
@@ -374,11 +369,6 @@ void FilletChamferPointArrayParam::set_use_distance(bool use_knot_distance )
use_distance = use_knot_distance;
}
-void FilletChamferPointArrayParam::set_unit(const gchar *abbr)
-{
- unit = abbr;
-}
-
void FilletChamferPointArrayParam::updateCanvasIndicators()
{
std::vector<Point> ts = data();
@@ -506,7 +496,6 @@ std::vector<double> FilletChamferPointArrayParam::get_times(int index, std::vect
time_it1 = 0;
}
double resultLenght = 0;
- time_it1_B = 1;
if (subpaths[positions.first].closed() && last) {
time_it2 = modf(to_time(index - positions.second , _vector[index - positions.second ][X]), &intpart);
resultLenght = it1_length + to_len(index - positions.second, _vector[index - positions.second ][X]);
@@ -813,7 +802,7 @@ void FilletChamferPointArrayParamKnotHolderEntity::knot_click(guint state)
bool aprox = (A[0].degreesOfFreedom() != 2 || B[0].degreesOfFreedom() != 2) && !_pparam->use_distance?true:false;
Geom::Point offset = Geom::Point(xModified, _pparam->_vector.at(_index).y());
Inkscape::UI::Dialogs::FilletChamferPropertiesDialog::showDialog(
- this->desktop, offset, this, _pparam->unit, _pparam->use_distance, aprox, _pparam->documentUnit);
+ this->desktop, offset, this, _pparam->use_distance, aprox);
}
}
diff --git a/src/live_effects/parameter/filletchamferpointarray.h b/src/live_effects/parameter/filletchamferpointarray.h
index 7849d5afb..9bfd86b41 100644
--- a/src/live_effects/parameter/filletchamferpointarray.h
+++ b/src/live_effects/parameter/filletchamferpointarray.h
@@ -53,8 +53,6 @@ public:
virtual void set_helper_size(int hs);
virtual void set_use_distance(bool use_knot_distance);
virtual void set_chamfer_steps(int value_chamfer_steps);
- virtual void set_document_unit(Glib::ustring value_document_unit);
- virtual void set_unit(const gchar *abbr);
virtual void addCanvasIndicators(SPLPEItem const *lpeitem,
std::vector<Geom::PathVector> &hp_vec);
virtual bool providesKnotHolderEntities() const {
@@ -89,8 +87,6 @@ private:
int helper_size;
int chamfer_steps;
bool use_distance;
- const gchar *unit;
- Glib::ustring documentUnit;
Geom::PathVector hp;
Geom::Piecewise<Geom::D2<Geom::SBasis> > last_pwd2;
diff --git a/src/live_effects/parameter/originalpath.cpp b/src/live_effects/parameter/originalpath.cpp
index 0884c4c9c..2741461be 100644
--- a/src/live_effects/parameter/originalpath.cpp
+++ b/src/live_effects/parameter/originalpath.cpp
@@ -8,10 +8,6 @@
# include "config.h"
#endif
-#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
-#include <glibmm/threads.h>
-#endif
-
#include <gtkmm/box.h>
#include "live_effects/parameter/originalpath.h"
diff --git a/src/live_effects/parameter/originalpatharray.cpp b/src/live_effects/parameter/originalpatharray.cpp
index 7706dbdf8..78e061e66 100644
--- a/src/live_effects/parameter/originalpatharray.cpp
+++ b/src/live_effects/parameter/originalpatharray.cpp
@@ -8,10 +8,6 @@
# include "config.h"
#endif
-#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
-#include <glibmm/threads.h>
-#endif
-
#include "live_effects/parameter/originalpatharray.h"
#include <gtkmm/widget.h>
diff --git a/src/live_effects/parameter/parameter.cpp b/src/live_effects/parameter/parameter.cpp
index beb750404..527bc06fe 100644
--- a/src/live_effects/parameter/parameter.cpp
+++ b/src/live_effects/parameter/parameter.cpp
@@ -42,13 +42,6 @@ Parameter::param_write_to_repr(const char * svgd)
param_effect->getRepr()->setAttribute(param_key.c_str(), svgd);
}
-// In gtk2, this wasn't an issue; we could toss around
-// G_MAXDOUBLE and not worry about size allocations. But
-// in gtk3, it is an issue: it allocates widget size for the maxmium
-// value you pass to it, leading to some insane lengths.
-// If you need this to be more, please be conservative about it.
-const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile.
-
void Parameter::write_to_SVG(void)
{
gchar * str = param_getSVGValue();
diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h
index 2e6cae49f..cc2c4f3d6 100644
--- a/src/live_effects/parameter/parameter.h
+++ b/src/live_effects/parameter/parameter.h
@@ -13,6 +13,13 @@
#include <2geom/forward.h>
#include <2geom/pathvector.h>
+// In gtk2, this wasn't an issue; we could toss around
+// G_MAXDOUBLE and not worry about size allocations. But
+// in gtk3, it is an issue: it allocates widget size for the maxmium
+// value you pass to it, leading to some insane lengths.
+// If you need this to be more, please be conservative about it.
+const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile.
+
class KnotHolder;
class SPLPEItem;
class SPDesktop;
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index ba95affd9..32e82ff8c 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -427,7 +427,13 @@ PathParam::paste_param_path(const char *svgd)
if (svgd && *svgd) {
// remove possible link to path
remove_link();
-
+ SPItem * item = SP_ACTIVE_DESKTOP->getSelection()->singleItem();
+ if (item != NULL) {
+ Geom::PathVector path_clipboard = sp_svg_read_pathv(svgd);
+ path_clipboard *= item->i2doc_affine().inverse();
+ svgd = sp_svg_write_path( path_clipboard );
+ }
+
param_write_to_repr(svgd);
signal_path_pasted.emit();
}