Commit a101ed2a authored by Michael Natterer's avatar Michael Natterer 😴

app, pdb: change range of brush-spacing to 0.01..5.0

And only use percent in the GUI.
parent 7c2e2265
......@@ -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);
......
......@@ -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);
}
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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.
*
......
......@@ -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 = (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment