diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-01-16 16:18:45 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-01-16 16:18:45 +0000 |
| commit | 03cb69220632b0c674efff5be3aab8be35d23eff (patch) | |
| tree | 464a1f74c57b796604ceb38c1687d579d2891800 /src/live_effects | |
| parent | update to trunk (diff) | |
| parent | Test implementation of 'shape-padding'. (diff) | |
| download | inkscape-03cb69220632b0c674efff5be3aab8be35d23eff.tar.gz inkscape-03cb69220632b0c674efff5be3aab8be35d23eff.zip | |
update to trunk
(bzr r13708.1.7)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 10 | ||||
| -rw-r--r-- | src/live_effects/lpe-show_handles.cpp | 18 | ||||
| -rw-r--r-- | src/live_effects/lpe-show_handles.h | 1 | ||||
| -rw-r--r-- | src/live_effects/lpe-taperstroke.cpp | 12 | ||||
| -rw-r--r-- | src/live_effects/parameter/filletchamferpointarray.cpp | 16 | ||||
| -rw-r--r-- | src/live_effects/parameter/originalpath.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/parameter/text.cpp | 3 |
8 files changed, 38 insertions, 30 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 119759b87..d2bdf2d8d 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -57,12 +57,12 @@ 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), + 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), - helper_size(_("Helper size with direction"), _("Helper size with direction"), "helper_size", &wr, this, 0) + helper_size(_("Helper size with direction:"), _("Helper size with direction"), "helper_size", &wr, this, 0) { registerParameter(&fillet_chamfer_values); registerParameter(&unit); diff --git a/src/live_effects/lpe-show_handles.cpp b/src/live_effects/lpe-show_handles.cpp index 7b2b445b7..2d8148730 100644 --- a/src/live_effects/lpe-show_handles.cpp +++ b/src/live_effects/lpe-show_handles.cpp @@ -25,15 +25,20 @@ LPEShowHandles::LPEShowHandles(LivePathEffectObject *lpeobject) nodes(_("Show nodes"), _("Show nodes"), "nodes", &wr, this, true), handles(_("Show handles"), _("Show handles"), "handles", &wr, this, true), originalPath(_("Show path"), _("Show path"), "originalPath", &wr, this, true), - scaleNodesAndHandles(_("Scale nodes and handles"), _("Scale nodes and handles"), "scaleNodesAndHandles", &wr, this, 10) + scaleNodesAndHandles(_("Scale nodes and handles"), _("Scale nodes and handles"), "scaleNodesAndHandles", &wr, this, 10), + rotateNodes(_("Rotate nodes"), _("Rotate nodes"), "rotateNodes", &wr, this, 0) { registerParameter(dynamic_cast<Parameter *>(&nodes)); registerParameter(dynamic_cast<Parameter *>(&handles)); registerParameter(dynamic_cast<Parameter *>(&originalPath)); registerParameter(dynamic_cast<Parameter *>(&scaleNodesAndHandles)); + registerParameter(dynamic_cast<Parameter *>(&rotateNodes)); scaleNodesAndHandles.param_set_range(0, 500.); scaleNodesAndHandles.param_set_increments(1, 1); scaleNodesAndHandles.param_set_digits(2); + rotateNodes.param_set_range(0, 365); + rotateNodes.param_set_increments(1, 1); + rotateNodes.param_set_digits(0); strokeWidth = 1.0; } @@ -158,10 +163,11 @@ LPEShowHandles::drawNode(Geom::Point p) if(strokeWidth * scaleNodesAndHandles > 0.0) { double diameter = strokeWidth * scaleNodesAndHandles; char const * svgd; - svgd = "M 0.55,0.5 A 0.05,0.05 0 0 1 0.5,0.55 0.05,0.05 0 0 1 0.45,0.5 0.05,0.05 0 0 1 0.5,0.45 0.05,0.05 0 0 1 0.55,0.5 Z M 0,0 1,0 1,1 0,1 Z"; + svgd = "M 0.05,0 A 0.05,0.05 0 0 1 0,0.05 0.05,0.05 0 0 1 -0.05,0 0.05,0.05 0 0 1 0,-0.05 0.05,0.05 0 0 1 0.05,0 Z M -0.5,-0.5 0.5,-0.5 0.5,0.5 -0.5,0.5 Z"; Geom::PathVector pathv = sp_svg_read_pathv(svgd); - pathv *= Geom::Affine(diameter,0,0,diameter,0,0); - pathv += p - Geom::Point(diameter/2,diameter/2); + pathv *= Geom::Rotate::from_degrees(rotateNodes); + pathv *= Geom::Scale (diameter); + pathv += p; outlinepath.push_back(pathv[0]); outlinepath.push_back(pathv[1]); } @@ -175,8 +181,8 @@ LPEShowHandles::drawHandle(Geom::Point p) char const * svgd; svgd = "M 0.7,0.35 A 0.35,0.35 0 0 1 0.35,0.7 0.35,0.35 0 0 1 0,0.35 0.35,0.35 0 0 1 0.35,0 0.35,0.35 0 0 1 0.7,0.35 Z"; Geom::PathVector pathv = sp_svg_read_pathv(svgd); - pathv *= Geom::Affine(diameter,0,0,diameter,0,0); - pathv += p - Geom::Point(diameter * 0.35,diameter * 0.35); + pathv *= Geom::Scale (diameter); + pathv += p-Geom::Point(diameter * 0.35,diameter * 0.35); outlinepath.push_back(pathv[0]); } } diff --git a/src/live_effects/lpe-show_handles.h b/src/live_effects/lpe-show_handles.h index 278908bb5..a405c26ee 100644 --- a/src/live_effects/lpe-show_handles.h +++ b/src/live_effects/lpe-show_handles.h @@ -44,6 +44,7 @@ private: BoolParam handles; BoolParam originalPath; ScalarParam scaleNodesAndHandles; + ScalarParam rotateNodes; double strokeWidth; static bool alertsOff; diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp index b595b8d55..7a024147c 100644 --- a/src/live_effects/lpe-taperstroke.cpp +++ b/src/live_effects/lpe-taperstroke.cpp @@ -71,12 +71,12 @@ static const Util::EnumDataConverter<unsigned> JoinTypeConverter(JoinType, sizeo LPETaperStroke::LPETaperStroke(LivePathEffectObject *lpeobject) : Effect(lpeobject), - line_width(_("Stroke width"), _("The (non-tapered) width of the path"), "stroke_width", &wr, this, 1.), - attach_start(_("Start offset"), _("Taper distance from path start"), "attach_start", &wr, this, 0.2), - attach_end(_("End offset"), _("The ending position of the taper"), "end_offset", &wr, this, 0.2), - smoothing(_("Taper smoothing"), _("Amount of smoothing to apply to the tapers"), "smoothing", &wr, this, 0.5), - join_type(_("Join type"), _("Join type for non-smooth nodes"), "jointype", JoinTypeConverter, &wr, this, LINEJOIN_EXTRAPOLATED), - miter_limit(_("Miter limit"), _("Limit for miter joins"), "miter_limit", &wr, this, 100.) + line_width(_("Stroke width:"), _("The (non-tapered) width of the path"), "stroke_width", &wr, this, 1.), + attach_start(_("Start offset:"), _("Taper distance from path start"), "attach_start", &wr, this, 0.2), + attach_end(_("End offset:"), _("The ending position of the taper"), "end_offset", &wr, this, 0.2), + smoothing(_("Taper smoothing:"), _("Amount of smoothing to apply to the tapers"), "smoothing", &wr, this, 0.5), + join_type(_("Join type:"), _("Join type for non-smooth nodes"), "jointype", JoinTypeConverter, &wr, this, LINEJOIN_EXTRAPOLATED), + miter_limit(_("Miter limit:"), _("Limit for miter joins"), "miter_limit", &wr, this, 100.) { show_orig_path = true; _provides_knotholder_entities = true; diff --git a/src/live_effects/parameter/filletchamferpointarray.cpp b/src/live_effects/parameter/filletchamferpointarray.cpp index 7d8c8e9b0..2ebe11b4b 100644 --- a/src/live_effects/parameter/filletchamferpointarray.cpp +++ b/src/live_effects/parameter/filletchamferpointarray.cpp @@ -779,19 +779,19 @@ void FilletChamferPointArrayParamKnotHolderEntity::knot_click(guint state) sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false); const gchar *tip; if (type >=3000 && type < 4000){ - tip = _("<b>Chamfer</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Chamfer</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } else if (type >=4000 && type < 5000) { - tip = _("<b>Inverse Chamfer</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Inverse Chamfer</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } else if (type == 2) { - tip = _("<b>Inverse Fillet</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Inverse Fillet</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } else { - tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } @@ -840,19 +840,19 @@ void FilletChamferPointArrayParam::addKnotHolderEntities(KnotHolder *knotholder, } const gchar *tip; if (_vector[i][Y] >=3000 && _vector[i][Y] < 4000){ - tip = _("<b>Chamfer</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Chamfer</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } else if (_vector[i][Y] >=4000 && _vector[i][Y] < 5000) { - tip = _("<b>Inverse Chamfer</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Inverse Chamfer</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } else if (_vector[i][Y] == 2) { - tip = _("<b>Inverse Fillet</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Inverse Fillet</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } else { - tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toggle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } diff --git a/src/live_effects/parameter/originalpath.cpp b/src/live_effects/parameter/originalpath.cpp index 6c4f2a100..0884c4c9c 100644 --- a/src/live_effects/parameter/originalpath.cpp +++ b/src/live_effects/parameter/originalpath.cpp @@ -27,7 +27,7 @@ #include "live_effects/effect.h" #include "inkscape.h" -#include "desktop-handles.h" +#include "desktop.h" #include "selection.h" #include "ui/icon-names.h" @@ -128,7 +128,7 @@ OriginalPathParam::on_select_original_button_click() if (desktop == NULL || original == NULL) { return; } - Inkscape::Selection *selection = sp_desktop_selection(desktop); + Inkscape::Selection *selection = desktop->getSelection(); selection->clear(); selection->set(original); } diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 2a14d4208..ba95affd9 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -30,7 +30,7 @@ // needed for on-canvas editting: #include "ui/tools-switch.h" #include "ui/shape-editor.h" -#include "desktop-handles.h" + #include "selection.h" // clipboard support #include "ui/clipboard.h" @@ -414,7 +414,7 @@ PathParam::linked_modified_callback(SPObject *linked_obj, guint /*flags*/) void PathParam::on_edit_button_click() { - SPItem * item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem(); + SPItem * item = SP_ACTIVE_DESKTOP->getSelection()->singleItem(); if (item != NULL) { param_editOncanvas(item, SP_ACTIVE_DESKTOP); } diff --git a/src/live_effects/parameter/text.cpp b/src/live_effects/parameter/text.cpp index a88ac7d75..234a6174d 100644 --- a/src/live_effects/parameter/text.cpp +++ b/src/live_effects/parameter/text.cpp @@ -19,6 +19,7 @@ #include "inkscape.h" #include "verbs.h" #include "display/canvas-text.h" + #include <2geom/sbasis-geometric.h> namespace Inkscape { @@ -33,7 +34,7 @@ TextParam::TextParam( const Glib::ustring& label, const Glib::ustring& tip, defvalue(default_value) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; // FIXME: we shouldn't use this! - canvas_text = (SPCanvasText *) sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, Geom::Point(0,0), ""); + canvas_text = (SPCanvasText *) sp_canvastext_new(desktop->getTempGroup(), desktop, Geom::Point(0,0), ""); sp_canvastext_set_text (canvas_text, default_value.c_str()); sp_canvastext_set_coords (canvas_text, 0, 0); } |
