summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2007-03-03 00:37:56 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2007-03-03 00:37:56 +0000
commitb004215551747be1821195193258f54905273c2b (patch)
treeb0145293093451d8adc9eb3555435f60af397c56 /src
parentmade it callable by other extensions. the workaround is sorta ugly, but it sh... (diff)
downloadinkscape-b004215551747be1821195193258f54905273c2b.tar.gz
inkscape-b004215551747be1821195193258f54905273c2b.zip
Add user-selectable paint bucket path offset size
(bzr r2508)
Diffstat (limited to 'src')
-rw-r--r--src/flood-context.cpp4
-rw-r--r--src/widgets/toolbox.cpp21
2 files changed, 24 insertions, 1 deletions
diff --git a/src/flood-context.cpp b/src/flood-context.cpp
index f58f70940..e909d446a 100644
--- a/src/flood-context.cpp
+++ b/src/flood-context.cpp
@@ -266,6 +266,8 @@ static void do_trace(GdkPixbuf *px, SPDesktop *desktop, NR::Matrix transform) {
long totalNodeCount = 0L;
+ double offset = prefs_get_double_attribute_limited("tools.paintbucket", "offset", 1.5, 0.0, 2.0);
+
for (unsigned int i=0 ; i<results.size() ; i++) {
Inkscape::Trace::TracingEngineResult result = results[i];
totalNodeCount += result.getNodeCount();
@@ -287,7 +289,7 @@ static void do_trace(GdkPixbuf *px, SPDesktop *desktop, NR::Matrix transform) {
Shape *expanded_path_shape = new Shape();
expanded_path_shape->ConvertToShape(path_shape, fill_nonZero);
- path_shape->MakeOffset(expanded_path_shape, 1.5, join_round, 4);
+ path_shape->MakeOffset(expanded_path_shape, offset, join_round, 4);
expanded_path_shape->ConvertToShape(path_shape, fill_positive);
Path *expanded_path = new Path();
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 70f70efad..2d77a4150 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -4438,6 +4438,12 @@ static void paintbucket_tolerance_changed(GtkAdjustment *adj, GtkWidget *tbl)
spinbutton_defocus(GTK_OBJECT(tbl));
}
+static void paintbucket_offset_changed(GtkAdjustment *adj, GtkWidget *tbl)
+{
+ prefs_set_double_attribute("tools.paintbucket", "offset", (gint)adj->value);
+ spinbutton_defocus(GTK_OBJECT(tbl));
+}
+
static GtkWidget *
sp_paintbucket_toolbox_new(SPDesktop *desktop)
{
@@ -4455,6 +4461,21 @@ sp_paintbucket_toolbox_new(SPDesktop *desktop)
AUX_SPACING);
}
+ // interval
+ gtk_box_pack_start(GTK_BOX(tbl), gtk_hbox_new(FALSE, 0), FALSE, FALSE, AUX_BETWEEN_BUTTON_GROUPS);
+
+ // Offset spinbox
+ {
+ GtkWidget *offset = sp_tb_spinbutton(_("Offset:"),
+ _("The amount to grow the path after it has been traced"),
+ "tools.paintbucket", "offset", 5, NULL, tbl, TRUE,
+ "inkscape:paintbucket-offset", 0.0, 2.0, 0.1, 0.5,
+ paintbucket_offset_changed, 1, 2);
+
+ gtk_box_pack_start(GTK_BOX(tbl), offset, FALSE, FALSE,
+ AUX_SPACING);
+ }
+
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of Paint Bucket fill objects"));
swatch->setDesktop (desktop);
swatch->setClickVerb (SP_VERB_CONTEXT_PAINTBUCKET_PREFS);