diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-05-09 18:34:01 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-05-09 18:34:01 +0000 |
| commit | 36bc16fc9772ce0271eb5ec62e2c03cb1038282e (patch) | |
| tree | c13d992c952bd21bc00c393d80bfe31c3b35284e /src/live_effects | |
| parent | prevent overflow index on a pathinfo function (diff) | |
| parent | Fix Doxyfile (diff) | |
| download | inkscape-36bc16fc9772ce0271eb5ec62e2c03cb1038282e.tar.gz inkscape-36bc16fc9772ce0271eb5ec62e2c03cb1038282e.zip | |
update to trunk
(bzr r13645.1.85)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/effect.cpp | 3 | ||||
| -rw-r--r-- | src/live_effects/effect.h | 1 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 7 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-gears.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-knot.cpp | 6 | ||||
| -rw-r--r-- | src/live_effects/lpe-lattice2.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-lattice2.h | 6 | ||||
| -rw-r--r-- | src/live_effects/lpe-roughen.cpp | 22 | ||||
| -rw-r--r-- | src/live_effects/lpe-roughen.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-taperstroke.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/parameter/originalpath.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/parameter/originalpatharray.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.cpp | 8 | ||||
| -rw-r--r-- | src/live_effects/parameter/satellitearray.cpp | 14 | ||||
| -rw-r--r-- | src/live_effects/parameter/satellitearray.h | 4 |
16 files changed, 24 insertions, 67 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 1da364580..53097171b 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -364,7 +364,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 @@ -454,7 +453,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); @@ -463,7 +461,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 a846e4bad..1b7f232ed 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -43,7 +43,6 @@ LPEFilletChamfer::LPEFilletChamfer(LivePathEffectObject *lpeobject) : Effect(lpeobject), satellites_param(_("pair_array_param"), _("pair_array_param"), "satellites_param", &wr, this), - unit(_("Unit:"), _("Unit"), "unit", &wr, this), method(_("Method:"), _("Methods to calculate the fillet or chamfer"), "method", FMConverter, &wr, this, FM_AUTO), radius(_("Radius (unit or %):"), _("Radius, in unit or %"), "radius", &wr, @@ -69,7 +68,6 @@ LPEFilletChamfer::LPEFilletChamfer(LivePathEffectObject *lpeobject) pointwise(NULL) { registerParameter(&satellites_param); - registerParameter(&unit); registerParameter(&method); registerParameter(&radius); registerParameter(&chamfer_steps); @@ -278,8 +276,7 @@ void LPEFilletChamfer::updateAmount() { double power = 0; if (!flexible) { - power = Inkscape::Util::Quantity::convert(radius, unit.get_abbreviation(), - defaultUnit); + power = radius; } else { power = radius / 100; } @@ -386,9 +383,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) c = path->get_original_curve(); } //fillet chamfer specific calls - satellites_param.setDocumentUnit(defaultUnit); satellites_param.setUseDistance(use_knot_distance); - satellites_param.setUnit(unit.get_abbreviation()); //mandatory call satellites_param.setEffectType(effectType()); diff --git a/src/live_effects/lpe-fillet-chamfer.h b/src/live_effects/lpe-fillet-chamfer.h index 6acc9fb40..9ec5b5e04 100644 --- a/src/live_effects/lpe-fillet-chamfer.h +++ b/src/live_effects/lpe-fillet-chamfer.h @@ -17,7 +17,6 @@ */ #include "live_effects/parameter/enum.h" -#include "live_effects/parameter/unit.h" #include "live_effects/parameter/satellitearray.h" #include "live_effects/effect.h" #include "helper/geom-pointwise.h" @@ -54,7 +53,6 @@ public: SatelliteArrayParam satellites_param; private: - 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-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-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..451810d04 100644 --- a/src/live_effects/lpe-taperstroke.cpp +++ b/src/live_effects/lpe-taperstroke.cpp @@ -389,13 +389,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/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/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(); } diff --git a/src/live_effects/parameter/satellitearray.cpp b/src/live_effects/parameter/satellitearray.cpp index 0e42c23c5..b0b036962 100644 --- a/src/live_effects/parameter/satellitearray.cpp +++ b/src/live_effects/parameter/satellitearray.cpp @@ -58,21 +58,11 @@ void SatelliteArrayParam::setPointwise(Geom::Pointwise *pointwise) param_set_and_write_new_value(_last_pointwise->getSatellites()); } -void SatelliteArrayParam::setDocumentUnit(Glib::ustring value_document_unit) -{ - _documentUnit = value_document_unit; -} - void SatelliteArrayParam::setUseDistance(bool use_knot_distance) { _use_distance = use_knot_distance; } -void SatelliteArrayParam::setUnit(const gchar *abbr) -{ - _unit = abbr; -} - void SatelliteArrayParam::setEffectType(EffectType et) { _effectType = et; @@ -460,8 +450,8 @@ void FilletChamferKnotHolderEntity::knot_click(guint state) : false; } Inkscape::UI::Dialogs::FilletChamferPropertiesDialog::showDialog( - this->desktop, amount, this, _pparam->_unit, _pparam->_use_distance, - aprox, _pparam->_documentUnit, _pparam->_vector.at(index)); + this->desktop, amount, this, _pparam->_use_distance, + aprox, _pparam->_vector.at(index)); } } diff --git a/src/live_effects/parameter/satellitearray.h b/src/live_effects/parameter/satellitearray.h index bb53af12b..2845e3969 100644 --- a/src/live_effects/parameter/satellitearray.h +++ b/src/live_effects/parameter/satellitearray.h @@ -55,9 +55,7 @@ public: return true; } void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); - void setDocumentUnit(Glib::ustring value_document__unit); void setUseDistance(bool use_knot_distance); - void setUnit(const gchar *abbr); void setEffectType(EffectType et); void setPointwise(Geom::Pointwise *pointwise); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, @@ -79,8 +77,6 @@ private: Geom::PathVector _hp; int _helper_size; bool _use_distance; - const gchar *_unit; - Glib::ustring _documentUnit; EffectType _effectType; Geom::Pointwise *_last_pointwise; |
