From b00a5a1724494bb5fad1b9fd94788f7ff318e549 Mon Sep 17 00:00:00 2001 From: johncoswell Date: Sat, 3 Mar 2007 00:37:56 +0000 Subject: [PATCH] Add user-selectable paint bucket path offset size --- src/flood-context.cpp | 4 +++- src/widgets/toolbox.cpp | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) 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 ; iConvertToShape(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); -- 2.30.2