summaryrefslogtreecommitdiffstats
path: root/src/widgets/mesh-toolbar.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-10-17 13:04:09 +0000
committertavmjong-free <tavmjong@free.fr>2016-10-17 13:04:09 +0000
commit619f8b5d9173f2bcc9d9aefccee832d686724e79 (patch)
tree1894d9cb61971d2118d103ae77ed564ce10a40f9 /src/widgets/mesh-toolbar.cpp
parent[Bug #1627166] Brazilian Portuguese translation for 0.92. (diff)
downloadinkscape-619f8b5d9173f2bcc9d9aefccee832d686724e79.tar.gz
inkscape-619f8b5d9173f2bcc9d9aefccee832d686724e79.zip
Add option to scale mesh to fit in bounding box.
(bzr r15173)
Diffstat (limited to 'src/widgets/mesh-toolbar.cpp')
-rw-r--r--src/widgets/mesh-toolbar.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/widgets/mesh-toolbar.cpp b/src/widgets/mesh-toolbar.cpp
index 0e689fee0..898104ad3 100644
--- a/src/widgets/mesh-toolbar.cpp
+++ b/src/widgets/mesh-toolbar.cpp
@@ -348,6 +348,14 @@ static void ms_pick_colors(void)
}
}
+static void ms_fit_mesh(void)
+{
+ MeshTool *mt = get_mesh_tool();
+ if (mt) {
+ sp_mesh_context_fit_mesh_in_bbox( mt );
+ }
+}
+
static void mesh_toolbox_watch_ec(SPDesktop* dt, Inkscape::UI::Tools::ToolBase* ec, GObject* holder);
/**
@@ -557,6 +565,17 @@ void sp_mesh_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObj
}
+ {
+ InkAction* act = ink_action_new( "MeshFitInBoundingBoxAction",
+ _("Scale mesh to bounding box:"),
+ _("Scale mesh to fit inside bounding box."),
+ INKSCAPE_ICON("mesh-gradient-fit"),
+ secondarySize );
+ g_object_set( act, "short_label", _("Fit mesh"), NULL );
+ g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(ms_fit_mesh), 0 );
+ gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
+ }
+
}
static void mesh_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)