diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c index 1063445a72..40fb32b5c8 100644 --- a/app/paint/gimpbrushcore.c +++ b/app/paint/gimpbrushcore.c @@ -417,7 +417,7 @@ gimp_brush_core_start (GimpPaintCore *paint_core, coords); } - core->spacing = (gdouble) paint_options->brush_spacing / 100; + core->spacing = paint_options->brush_spacing; core->brush = core->main_brush; @@ -556,7 +556,7 @@ gimp_brush_core_interpolate (GimpPaintCore *paint_core, * spacing has a hard defined max. */ dyn_spacing = (core->spacing + - ((2.0 - core->spacing) * ( 1.0 - dyn_spacing))); + ((2.0 - core->spacing) * (1.0 - dyn_spacing))); /* Limiting spacing to minimum 1% */ dyn_spacing = MAX (core->spacing, dyn_spacing); diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c index b5733f348e..14211a5bbe 100644 --- a/app/paint/gimppaintoptions.c +++ b/app/paint/gimppaintoptions.c @@ -44,7 +44,7 @@ #define DEFAULT_BRUSH_ASPECT_RATIO 0.0 #define DEFAULT_BRUSH_ANGLE 0.0 -#define DEFAULT_BRUSH_SPACING 10.0 +#define DEFAULT_BRUSH_SPACING 0.1 #define DEFAULT_BRUSH_HARDNESS 1.0 /* Generated brushes have their own */ #define DEFAULT_BRUSH_FORCE 0.5 @@ -184,7 +184,7 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass) GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_SPACING, "brush-spacing", _("Brush Spacing"), - 1.0, 5000.0, DEFAULT_BRUSH_SPACING, + 0.01, 50.0, DEFAULT_BRUSH_SPACING, GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_HARDNESS, @@ -833,7 +833,7 @@ gimp_paint_options_set_default_brush_spacing (GimpPaintOptions *paint_options, if (brush) { g_object_set (paint_options, - "brush-spacing", (gdouble) gimp_brush_get_spacing (brush), + "brush-spacing", (gdouble) gimp_brush_get_spacing (brush) / 100.0, NULL); } } diff --git a/app/pdb/context-cmds.c b/app/pdb/context-cmds.c index bfb3967b3e..7de9cf2fad 100644 --- a/app/pdb/context-cmds.c +++ b/app/pdb/context-cmds.c @@ -2813,8 +2813,8 @@ register_context_procs (GimpPDB *pdb) gimp_procedure_add_return_value (procedure, g_param_spec_double ("spacing", "spacing", - "Brush spacing as percent of size", - 0, G_MAXDOUBLE, 0, + "Brush spacing as fraction of size", + 0.01, 50.0, 0.01, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -2836,8 +2836,8 @@ register_context_procs (GimpPDB *pdb) gimp_procedure_add_argument (procedure, g_param_spec_double ("spacing", "spacing", - "Brush spacing as percent of size", - 0, G_MAXDOUBLE, 0, + "Brush spacing as fraction of size", + 0.01, 50.0, 0.01, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c index 848c39226a..abc6639b88 100644 --- a/app/tools/gimppaintoptions-gui.c +++ b/app/tools/gimppaintoptions-gui.c @@ -178,7 +178,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options) hbox = gimp_paint_options_gui_scale_with_reset_button (config, "brush-spacing", _("Spacing"), _("Reset spacing to brush's native spacing"), - 0.1, 1.0, 2, 1.0, 200.0, 1.0, 1.7, + 0.1, 1.0, 1, 1.0, 200.0, 100.0, 1.7, G_CALLBACK (gimp_paint_options_gui_reset_spacing)); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); @@ -186,7 +186,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options) hbox = gimp_paint_options_gui_scale_with_reset_button (config, "brush-hardness", _("Hardness"), _("Reset hardness to default"), - 0.001, 0.01, 3, 0.0, 100.0, 100.0, 1.0, + 0.1, 1.0, 1, 0.0, 100.0, 100.0, 1.0, G_CALLBACK (gimp_paint_options_gui_reset_hardness)); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); @@ -194,7 +194,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options) hbox = gimp_paint_options_gui_scale_with_reset_button (config, "brush-force", _("Force"), _("Reset force to default"), - 0.001, 0.01, 2, 0.0, 100.0, 100.0, 1.0, + 0.1, 1.0, 1, 0.0, 100.0, 100.0, 1.0, G_CALLBACK (gimp_paint_options_gui_reset_force)); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); diff --git a/libgimp/gimpcontext_pdb.c b/libgimp/gimpcontext_pdb.c index f94023440b..b4fb78f3a2 100644 --- a/libgimp/gimpcontext_pdb.c +++ b/libgimp/gimpcontext_pdb.c @@ -856,7 +856,7 @@ gimp_context_set_brush_angle (gdouble angle) * Get the brush spacing as percent of size for brush based paint * tools. * - * Returns: Brush spacing as percent of size. + * Returns: Brush spacing as fraction of size. * * Since: GIMP 2.10 **/ @@ -881,7 +881,7 @@ gimp_context_get_brush_spacing (void) /** * gimp_context_set_brush_spacing: - * @spacing: Brush spacing as percent of size. + * @spacing: Brush spacing as fraction of size. * * Set brush spacing as percent of size. * diff --git a/tools/pdbgen/pdb/context.pdb b/tools/pdbgen/pdb/context.pdb index adb52e0396..b72f4e4320 100644 --- a/tools/pdbgen/pdb/context.pdb +++ b/tools/pdbgen/pdb/context.pdb @@ -709,8 +709,8 @@ sub context_get_brush_spacing { &adeath_pdb_misc('2014', '2.10'); @outargs = ( - { name => "spacing", type => "0 < float", - desc => "Brush spacing as percent of size" } + { name => "spacing", type => "0.01 <= float <= 50.0", + desc => "Brush spacing as fraction of size" } ); %invoke = ( @@ -739,8 +739,8 @@ sub context_set_brush_spacing { &adeath_pdb_misc('2014', '2.10'); @inargs = ( - { name => "spacing", type => "0 < float", - desc => "Brush spacing as percent of size" } + { name => "spacing", type => "0.01 <= float <= 50.0", + desc => "Brush spacing as fraction of size" } ); %invoke = (