diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-10-25 16:54:27 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-10-25 16:54:27 +0000 |
| commit | d3e163d627550bf1016b35d4afb75c024a508922 (patch) | |
| tree | 4534eab40e30dc768b73859b134d2bceba272d4b /src | |
| parent | Removing new roughen changes to create a new Spray branch (diff) | |
| download | inkscape-d3e163d627550bf1016b35d4afb75c024a508922.tar.gz inkscape-d3e163d627550bf1016b35d4afb75c024a508922.zip | |
Cleanup Spray tool improvements
(bzr r14422.3.1)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-roughen.cpp | 91 | ||||
| -rw-r--r-- | src/live_effects/lpe-roughen.h | 3 | ||||
| -rw-r--r-- | src/ui/tools/spray-tool.cpp | 187 | ||||
| -rw-r--r-- | src/ui/tools/spray-tool.h | 4 | ||||
| -rw-r--r-- | src/widgets/spray-toolbar.cpp | 41 | ||||
| -rw-r--r-- | src/widgets/spray-toolbar.h | 2 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 7 |
7 files changed, 72 insertions, 263 deletions
diff --git a/src/live_effects/lpe-roughen.cpp b/src/live_effects/lpe-roughen.cpp index cea91509e..55ca77e9c 100644 --- a/src/live_effects/lpe-roughen.cpp +++ b/src/live_effects/lpe-roughen.cpp @@ -183,19 +183,15 @@ double LPERoughen::sign(double random_number) return random_number; } -Geom::Point LPERoughen::randomize(double max_lenght, double direction) +Geom::Point LPERoughen::randomize(double max_lenght, bool is_node) { - 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)); - if( direction != 0){ - int angle = (int)max_smooth_angle; - if (angle == 0){ - angle = 1; - } - double dist = Geom::distance(Geom::Point(0,0),output); - output = Geom::Point::polar(direction + sign(Geom::deg_to_rad(rand() % angle)), dist); + double factor = 1.0/3.0; + if(is_node){ + factor = 1.0; } + double displace_x_parsed = displace_x * global_randomize * factor; + double displace_y_parsed = displace_y * global_randomize * factor; + Geom::Point output = Geom::Point(sign(displace_x_parsed), sign(displace_y_parsed)); if( fixed_displacement ){ Geom::Ray ray(Geom::Point(0,0),output); output = Geom::Point::polar(ray.angle(), max_lenght); @@ -203,6 +199,19 @@ Geom::Point LPERoughen::randomize(double max_lenght, double direction) return output; } +Geom::Point LPERoughen::randomize(double lenght, Geom::Point start, Geom::Point end) +{ + int angle = (int)max_smooth_angle; + if (angle == 0){ + angle = 1; + } + Geom::Ray ray(start, end); + if(!fixed_displacement ){ + lenght = Geom::distance(start, end); + } + return Geom::Point::polar(ray.angle() + sign(Geom::deg_to_rad(rand() % angle)), lenght) + start; +} + void LPERoughen::doEffect(SPCurve *curve) { Geom::PathVector const original_pathv = pathv_to_linear_and_cubic_beziers(curve->get_pathvector()); @@ -317,9 +326,9 @@ SPCurve const * LPERoughen::addNodesAndJitter(Geom::Curve const * A, Geom::Point Geom::Point point_b2(0, 0); Geom::Point point_b3(0, 0); if (shift_nodes) { - point_a3 = randomize(max_lenght); + point_a3 = randomize(max_lenght, true); if(last){ - point_b3 = randomize(max_lenght); + point_b3 = randomize(max_lenght, true); } } if (handles == HM_RAND || handles == HM_SMOOTH) { @@ -350,53 +359,55 @@ SPCurve const * LPERoughen::addNodesAndJitter(Geom::Curve const * A, Geom::Point std::pair<Geom::CubicBezier, Geom::CubicBezier> div = cubic->subdivide(t); std::vector<Geom::Point> seg1 = div.first.controlPoints(), seg2 = div.second.controlPoints(); + point_b1 = randomize(max_lenght, seg1[3] + point_a3, seg2[1] + point_a3); + point_b2 = seg1[2]; + point_b3 = seg2[3] + point_b3; + point_a3 = seg1[3] + point_a3; Geom::Ray ray(prev,A->initialPoint()); - point_a1 = Geom::Point::polar(ray.angle(), max_lenght); + point_a1 = A->initialPoint() + Geom::Point::polar(ray.angle(), max_lenght); if(prev == Geom::Point(0,0)){ point_a1 = randomize(max_lenght); } - ray.setPoints(seg1[3] + point_a3, seg2[1] + point_a3); - point_b1 = randomize(max_lenght, ray.angle()); if(last){ - ray.setPoints(seg2[3] + point_b3, A->pointAt(1 - (t / 3)) + point_b3); - point_b2 = randomize(max_lenght, ray.angle()); + Geom::Path b2(point_b3); + b2.appendNew<Geom::LineSegment>(point_a3); + point_b2 = randomize(max_lenght, point_b3, b2.pointAt(1.0/3.0)); } - ray.setPoints(seg2[1] + point_a3 + point_b1, seg2[0] + point_a3); - point_a2 = Geom::Point::polar(ray.angle(), max_lenght); + ray.setPoints(point_b1, point_a3); + point_a2 = point_a3 + Geom::Point::polar(ray.angle(), max_lenght); if(last){ - prev = A->pointAt(1 - (t / 3)) + point_b2 + point_b3; + prev = point_b2; } else { - prev = seg1[3] + point_a2 + point_a3; + prev = point_a2; } out->moveto(seg1[0]); - out->curveto(seg1[0] + point_a1, seg1[3] + point_a2 + point_a3, seg1[3] + point_a3); - if(last){ - out->curveto(seg2[1] + point_a3 + point_b1, A->pointAt(1 - (t / 3)) + point_b2 + point_b3, seg2[3] + point_b3); - } else { - out->curveto(seg2[1] + point_a3 + point_b1, seg2[2] + point_b2 + point_b3, seg2[3] + point_b3); - } + out->curveto(point_a1,point_a2,point_a3); + out->curveto(point_b1, point_b2, point_b3); } else if(handles == HM_SMOOTH && !cubic) { + point_b1 = randomize(max_lenght, A->pointAt(t) + point_a3, A->pointAt(t + (t / 3))); + point_b2 = A->pointAt(t +((t / 3) * 2)); + point_b3 = A->finalPoint() + point_b3; + point_a3 = A->pointAt(t) + point_a3; Geom::Ray ray(prev,A->initialPoint()); - point_a1 = Geom::Point::polar(ray.angle(), max_lenght); - if(prev==Geom::Point(0,0)){ + point_a1 = A->initialPoint() + Geom::Point::polar(ray.angle(), max_lenght); + if(prev == Geom::Point(0,0)){ point_a1 = randomize(max_lenght); } - ray.setPoints(A->pointAt(t) + point_a3, A->pointAt(t + (t / 3)) + point_a3); - point_b1 = randomize(max_lenght, ray.angle()); if(last){ - ray.setPoints(A->finalPoint() + point_b3, A->pointAt(t +((t / 3) * 2)) + point_b3); - point_b2 = randomize(max_lenght, ray.angle()); + Geom::Path b2(point_b3); + b2.appendNew<Geom::LineSegment>(point_a3); + point_b2 = randomize(max_lenght, point_b3, b2.pointAt(1.0/3.0)); } - ray.setPoints(A->pointAt(t + (t / 3)) + point_a3 + point_b1, A->pointAt(t) + point_a3); - point_a2 = Geom::Point::polar(ray.angle(), max_lenght); + ray.setPoints(point_b1, point_a3); + point_a2 = point_a3 + Geom::Point::polar(ray.angle(), max_lenght); if(last){ - prev = A->pointAt(t +((t / 3) * 2)) + point_b2 + point_b3; + prev = point_b2; } else { - prev = A->pointAt(t) + point_a3 + point_a2; + prev = point_a2; } out->moveto(A->initialPoint()); - out->curveto(A->initialPoint() + point_a1, A->pointAt(t) + point_a3 + point_a2, A->pointAt(t) + point_a3); - out->curveto(A->pointAt(t + (t / 3)) + point_a3 + point_b1, A->pointAt(t +((t / 3) * 2)) + point_b2 + point_b3, A->finalPoint() + point_b3); + out->curveto(point_a1,point_a2,point_a3); + out->curveto(point_b1, point_b2, point_b3); } else if (cubic) { std::pair<Geom::CubicBezier, Geom::CubicBezier> div = cubic->subdivide(t); std::vector<Geom::Point> seg1 = div.first.controlPoints(), diff --git a/src/live_effects/lpe-roughen.h b/src/live_effects/lpe-roughen.h index e3ede2c2d..6224c09fa 100644 --- a/src/live_effects/lpe-roughen.h +++ b/src/live_effects/lpe-roughen.h @@ -45,7 +45,8 @@ public: virtual void doEffect(SPCurve *curve); virtual double sign(double randNumber); - virtual Geom::Point randomize(double max_lenght, double direction = 0); + virtual Geom::Point randomize(double max_lenght, bool is_node = false); + virtual Geom::Point randomize(double lenght, Geom::Point start, Geom::Point end); virtual void doBeforeEffect(SPLPEItem const * lpeitem); virtual SPCurve const * addNodesAndJitter(Geom::Curve const * A, Geom::Point &prev, Geom::Point &last_move, double t, bool last); virtual SPCurve *jitter(Geom::Curve const * A, Geom::Point &prev, Geom::Point &last_move); diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index 69a6f0435..e2be5ca4b 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -12,7 +12,6 @@ * Steren GIANNINI (steren.giannini@gmail.com) * Jon A. Cruz <jon@joncruz.org> * Abhishek Sharma - * Jabiertxo Arraiza <jabier.arraiza@marker.es> * * Copyright (C) 2009 authors * @@ -50,7 +49,6 @@ #include "path-chemistry.h" #include "sp-text.h" -#include "sp-root.h" #include "sp-flowtext.h" #include "display/sp-canvas.h" #include "display/canvas-bpath.h" @@ -59,9 +57,6 @@ #include "livarot/Shape.h" #include <2geom/circle.h> #include <2geom/transforms.h> -#include <2geom/path-intersection.h> -#include <2geom/pathvector.h> -#include <2geom/crossing.h> #include "preferences.h" #include "style.h" #include "box3d.h" @@ -156,8 +151,6 @@ SprayTool::SprayTool() , is_dilating(false) , has_dilated(false) , dilate_area(NULL) - , overlap(false) - , offset(0) { } @@ -230,8 +223,6 @@ void SprayTool::setup() { sp_event_context_read(this, "standard_deviation"); sp_event_context_read(this, "usepressure"); sp_event_context_read(this, "Scale"); - sp_event_context_read(this, "offset"); - sp_event_context_read(this, "overlap"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool("/tools/spray/selcue")) { @@ -269,10 +260,6 @@ void SprayTool::set(const Inkscape::Preferences::Entry& val) { this->tilt = CLAMP(val.getDouble(0.1), 0, 1000.0); } else if (path == "ratio") { this->ratio = CLAMP(val.getDouble(), 0.0, 0.9); - } else if (path == "offset") { - this->offset = CLAMP(val.getDouble(), -1000.0, 1000.0); - } else if (path == "overlap") { - this->overlap = val.getBool(); } } @@ -345,64 +332,6 @@ static void random_position(double &radius, double &angle, double &a, double &s, } -static void sp_spray_transform_path(SPItem * item, Geom::Path &path, Geom::Affine affine, Geom::Point center){ - SPDocument *doc = item->document; - path *= doc->getRoot()->c2p.inverse(); - path *= item->transform.inverse(); - Geom::Affine dt2p; - if (item->parent) { - dt2p = static_cast<SPItem *>(item->parent)->i2dt_affine().inverse(); - } else { - SPDesktop *dt = SP_ACTIVE_DESKTOP; - dt2p = dt->dt2doc(); - } - Geom::Affine i2dt = item->i2dt_affine() * Geom::Translate(center).inverse() * affine * Geom::Translate(center); - path *= i2dt * dt2p; - path *= doc->getRoot()->c2p; -} - -static bool fit_item(SPDesktop *desktop, - SPItem *item, - Geom::OptRect bbox, - gchar const * spray_origin, - Geom::Point move, - Geom::Point center, - double angle, - double _scale, - double scale, - double offset) -{ - if(offset < 0){ - offset = std::min(std::min(std::abs(offset), bbox->width()/2.0),std::min(std::abs(offset), bbox->height()/2.0)) * -1; - } - bbox = Geom::Rect(Geom::Point(bbox->left() - offset, bbox->top() - offset),Geom::Point(bbox->right() + offset, bbox->bottom() + offset)); - Geom::Path path; - path.start(Geom::Point(bbox->left(), bbox->top())); - path.appendNew<Geom::LineSegment>(Geom::Point(bbox->right(), bbox->top())); - path.appendNew<Geom::LineSegment>(Geom::Point(bbox->right(), bbox->bottom())); - path.appendNew<Geom::LineSegment>(Geom::Point(bbox->left(), bbox->bottom())); - path.close(true); - Geom::Translate const s(center); - sp_spray_transform_path(item, path, Geom::Scale(_scale), center); - sp_spray_transform_path(item, path, Geom::Scale(scale), center); - sp_spray_transform_path(item, path, Geom::Rotate(angle), center); - path *= Geom::Translate(move[Geom::X], move[Geom::Y]); - path *= desktop->doc2dt(); - bbox = path.boundsFast(); - std::vector<SPItem*> items_down = desktop->getDocument()->getItemsPartiallyInBox(desktop->dkey, *bbox); - for (std::vector<SPItem*>::const_iterator i=items_down.begin(); i!=items_down.end(); i++) { - SPItem *item_down = *i; - gchar const * item_down_sharp = g_strdup_printf("#%s", item_down->getId()); - if(strcmp(item_down_sharp, spray_origin) == 0 || - (item_down->getAttribute("inkscape:spray-origin") && - strcmp(item_down->getAttribute("inkscape:spray-origin"),spray_origin) == 0 )) - { - return false; - } - } - return true; -} - static bool sp_spray_recursive(SPDesktop *desktop, Inkscape::Selection *selection, SPItem *item, @@ -419,10 +348,7 @@ static bool sp_spray_recursive(SPDesktop *desktop, double ratio, double tilt, double rotation_variation, - gint _distrib, - bool overlap, - double offset, - size_t &limit) + gint _distrib) { bool did = false; @@ -445,66 +371,27 @@ static bool sp_spray_recursive(SPDesktop *desktop, if (mode == SPRAY_MODE_COPY) { Geom::OptRect a = item->documentVisualBounds(); if (a) { + SPItem *item_copied; if(_fid <= population) { - SPDocument *doc = item->document; - gchar const * spray_origin; - if(!item->getAttribute("inkscape:spray-origin")){ - spray_origin = g_strdup_printf("#%s", item->getId()); - } else { - spray_origin = item->getAttribute("inkscape:spray-origin"); - } - Geom::Point center = item->getCenter(); - Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); - if(overlap){ - if(!fit_item(desktop, item, a, spray_origin, move, center, angle, _scale, scale, offset)){ - limit += 1; - //Limit recursion to 10 levels - //Seems enoght to chech if thete is place to put new copie - if(limit < 11){ - return sp_spray_recursive(desktop, - selection, - item, - p, - Geom::Point(), - mode, - radius, - population, - scale, - scale_variation, - false, - mean, - standard_deviation, - ratio, - tilt, - rotation_variation, - _distrib, - overlap, - offset, - limit); - } else { - return false; - } - } - } - SPItem *item_copied; // Duplicate + SPDocument *doc = item->document; Inkscape::XML::Document* xml_doc = doc->getReprDoc(); Inkscape::XML::Node *old_repr = item->getRepr(); Inkscape::XML::Node *parent = old_repr->parent(); Inkscape::XML::Node *copy = old_repr->duplicate(xml_doc); - if(!copy->attribute("inkscape:spray-origin")){ - copy->setAttribute("inkscape:spray-origin", spray_origin); - } parent->appendChild(copy); + SPObject *new_obj = doc->getObjectByRepr(copy); item_copied = dynamic_cast<SPItem *>(new_obj); // Conversion object->item - sp_spray_scale_rel(center,desktop, item_copied, Geom::Scale(_scale)); - sp_spray_scale_rel(center,desktop, item_copied, Geom::Scale(scale)); + Geom::Point center=item->getCenter(); + sp_spray_scale_rel(center,desktop, item_copied, Geom::Scale(_scale,_scale)); + sp_spray_scale_rel(center,desktop, item_copied, Geom::Scale(scale,scale)); + sp_spray_rotate_rel(center,desktop,item_copied, Geom::Rotate(angle)); // Move the cursor p + Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); sp_item_move_rel(item_copied, Geom::Translate(move[Geom::X], -move[Geom::Y])); - Inkscape::GC::release(copy); did = true; } } @@ -538,13 +425,6 @@ static bool sp_spray_recursive(SPDesktop *desktop, if (_fid <= population) { // Rules the population of objects sprayed // Duplicates the parent item Inkscape::XML::Node *copy = old_repr->duplicate(xml_doc); - gchar const * spray_origin; - if(!copy->attribute("inkscape:spray-origin")){ - spray_origin = g_strdup_printf("#%s", old_repr->attribute("id")); - copy->setAttribute("inkscape:spray-origin", spray_origin); - } else { - spray_origin = copy->attribute("inkscape:spray-origin"); - } parent->appendChild(copy); SPObject *new_obj = doc->getObjectByRepr(copy); item_copied = dynamic_cast<SPItem *>(new_obj); @@ -576,45 +456,8 @@ static bool sp_spray_recursive(SPDesktop *desktop, Geom::OptRect a = item->documentVisualBounds(); if (a) { if(_fid <= population) { - SPDocument *doc = item->document; - gchar const * spray_origin; - if(!item->getAttribute("inkscape:spray-origin")){ - spray_origin = g_strdup_printf("#%s", item->getId()); - } else { - spray_origin = item->getAttribute("inkscape:spray-origin"); - } - Geom::Point center=item->getCenter(); - Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); - if(overlap){ - if(!fit_item(desktop, item, a, spray_origin, move, center, angle, _scale, scale, offset)){ - limit += 1; - if(limit < 11){ - return sp_spray_recursive(desktop, - selection, - item, - p, - Geom::Point(), - mode, - radius, - population, - scale, - scale_variation, - false, - mean, - standard_deviation, - ratio, - tilt, - rotation_variation, - _distrib, - overlap, - offset, - limit); - } else { - return false; - } - } - } SPItem *item_copied; + SPDocument *doc = item->document; Inkscape::XML::Document* xml_doc = doc->getReprDoc(); Inkscape::XML::Node *old_repr = item->getRepr(); Inkscape::XML::Node *parent = old_repr->parent(); @@ -624,9 +467,6 @@ static bool sp_spray_recursive(SPDesktop *desktop, // Ad the clone to the list of the parent's children parent->appendChild(clone); // Generates the link between parent and child attributes - if(!clone->attribute("inkscape:spray-origin")){ - clone->setAttribute("inkscape:spray-origin", spray_origin); - } gchar *href_str = g_strdup_printf("#%s", old_repr->attribute("id")); clone->setAttribute("xlink:href", href_str, false); g_free(href_str); @@ -634,12 +474,15 @@ static bool sp_spray_recursive(SPDesktop *desktop, SPObject *clone_object = doc->getObjectByRepr(clone); // Conversion object->item item_copied = dynamic_cast<SPItem *>(clone_object); + Geom::Point center = item->getCenter(); sp_spray_scale_rel(center, desktop, item_copied, Geom::Scale(_scale, _scale)); sp_spray_scale_rel(center, desktop, item_copied, Geom::Scale(scale, scale)); sp_spray_rotate_rel(center, desktop, item_copied, Geom::Rotate(angle)); + Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); sp_item_move_rel(item_copied, Geom::Translate(move[Geom::X], -move[Geom::Y])); Inkscape::GC::release(clone); + did = true; } } @@ -686,8 +529,8 @@ static bool sp_spray_dilate(SprayTool *tc, Geom::Point /*event_p*/, Geom::Point for(std::vector<SPItem*>::const_iterator i=items.begin();i!=items.end();i++){ SPItem *item = *i; g_assert(item != NULL); - size_t limit = 0; - if (sp_spray_recursive(desktop, selection, item, p, vector, tc->mode, radius, population, tc->scale, tc->scale_variation, reverse, move_mean, move_standard_deviation, tc->ratio, tc->tilt, tc->rotation_variation, tc->distrib, tc->overlap, tc->offset, limit)) { + + if (sp_spray_recursive(desktop, selection, item, p, vector, tc->mode, radius, population, tc->scale, tc->scale_variation, reverse, move_mean, move_standard_deviation, tc->ratio, tc->tilt, tc->rotation_variation, tc->distrib)) { did = true; } } diff --git a/src/ui/tools/spray-tool.h b/src/ui/tools/spray-tool.h index a46f2cc90..8df730201 100644 --- a/src/ui/tools/spray-tool.h +++ b/src/ui/tools/spray-tool.h @@ -12,7 +12,6 @@ * BenoƮt LAVORATA * Vincent MONTAGNE * Pierre BARBRY-BLOT - * Jabiertxo Arraiza JABIERTXOF * * Copyright (C) 2009 authors * @@ -87,8 +86,7 @@ public: bool has_dilated; Geom::Point last_push; SPCanvasItem *dilate_area; - bool overlap; - double offset; + sigc::connection style_set_connection; static const std::string prefsPath; diff --git a/src/widgets/spray-toolbar.cpp b/src/widgets/spray-toolbar.cpp index 6a062bc46..183814b7e 100644 --- a/src/widgets/spray-toolbar.cpp +++ b/src/widgets/spray-toolbar.cpp @@ -15,11 +15,10 @@ * Tavmjong Bah <tavmjong@free.fr> * Abhishek Sharma * Kris De Gussem <Kris.DeGussem@gmail.com> - * Jabiertxo Arraiza <jabier.arraiza@marker.es> * * Copyright (C) 2004 David Turner * Copyright (C) 2003 MenTaLguY - * Copyright (C) 1999-2015 authors + * Copyright (C) 1999-2011 authors * Copyright (C) 2001-2002 Ximian, Inc. * * Released under GNU GPL, read the file 'COPYING' for more information @@ -103,19 +102,6 @@ static void sp_spray_scale_value_changed( GtkAdjustment *adj, GObject * /*tbl*/ gtk_adjustment_get_value(adj)); } -static void sp_spray_offset_value_changed( GtkAdjustment *adj, GObject * /*tbl*/ ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setDouble( "/tools/spray/offset", - gtk_adjustment_get_value(adj)); -} - -static void sp_toggle_not_overlap( GtkToggleAction* act, gpointer data ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gboolean active = gtk_toggle_action_get_active(act); - prefs->setBool("/tools/spray/overlap", active); -} void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) { @@ -281,31 +267,6 @@ void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj g_object_set_data( holder, "spray_scale", eact ); } - { - InkToggleAction* act = ink_toggle_action_new( "SprayNotOverlapAction", - _("Not overlap"), - _("Not overlap"), - INKSCAPE_ICON("distribute-randomize"), - secondarySize ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/overlap", true) ); - g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_not_overlap), desktop) ; - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); - } - - /* Offset */ - { - EgeAdjustmentAction *eact = create_adjustment_action( "SprayToolOffsetAction", - _("Offset"), _("Offset:"), - _("Base offset size"), - "/tools/spray/offset", 0.0, - GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, - -1000.0, 1000.0, 1.0, 4.0, - 0, 0, 0, - sp_spray_offset_value_changed, NULL, 0 , 2); - gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); - } - - } diff --git a/src/widgets/spray-toolbar.h b/src/widgets/spray-toolbar.h index 30d8233ca..d1d5c7b4c 100644 --- a/src/widgets/spray-toolbar.h +++ b/src/widgets/spray-toolbar.h @@ -21,7 +21,7 @@ * * Copyright (C) 2004 David Turner * Copyright (C) 2003 MenTaLguY - * Copyright (C) 1999-2015 authors + * Copyright (C) 1999-2011 authors * Copyright (C) 2001-2002 Ximian, Inc. * * Released under GNU GPL, read the file 'COPYING' for more information diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index f512819e9..a1c32352c 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -16,11 +16,10 @@ * Tavmjong Bah <tavmjong@free.fr> * Abhishek Sharma * Kris De Gussem <Kris.DeGussem@gmail.com> - * Jabiertxo Arraiza <jabier.arraiza@marker.es> * * Copyright (C) 2004 David Turner * Copyright (C) 2003 MenTaLguY - * Copyright (C) 1999-2015 authors + * Copyright (C) 1999-2011 authors * Copyright (C) 2001-2002 Ximian, Inc. * * Released under GNU GPL, read the file 'COPYING' for more information @@ -318,10 +317,6 @@ static gchar const * ui_descr = " <separator />" " <toolitem action='SprayStandard_deviationAction' />" " <toolitem action='SprayMeanAction' />" - " <separator />" - " <toolitem action='SprayNotOverlapAction' />" - " <toolitem action='SprayToolOffsetAction' />" - " </toolbar>" " <toolbar name='ZoomToolbar'>" |
