Bill Skaggs <weskaggs@primate.ucdavis.edu>

* app/paint/gimpbrushcore.c
	* app/paint/gimppaintoptions.c
	* app/paint/gimppaintoptions.h
	* app/tools/gimppaintoptions-gui.c: reverted last change, and
	applied full patch from Dave Ahlswede in bug #149576.
This commit is contained in:
William Skaggs 2005-01-01 00:04:37 +00:00
parent 8a651f34df
commit 7a3eee51f0
5 changed files with 41 additions and 11 deletions

View file

@ -1,3 +1,11 @@
2004-12-31 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/paint/gimpbrushcore.c
* app/paint/gimppaintoptions.c
* app/paint/gimppaintoptions.h
* app/tools/gimppaintoptions-gui.c: reverted last change, and
applied full patch from Dave Ahlswede in bug #149576.
2004-12-31 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* tools/pdbgen/pdb/gradient.pdb: added gradient-is-editable

View file

@ -36,7 +36,6 @@
#include "gimpbrushcore.h"
#include "gimpbrushcore-kernels.h"
#include "gimppaintoptions.h"
#include "gimpairbrushoptions.h"
#include "gimp-intl.h"
@ -663,11 +662,10 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
{
GimpPressureOptions *pressure_options = paint_options->pressure_options;
if (pressure_options->size)
if (GIMP_IS_AIRBRUSH_OPTIONS (paint_options))
core->scale = 1.0 - 0.9 * paint_core->cur_coords.pressure;
else
core->scale = paint_core->cur_coords.pressure;
if (pressure_options->inv_size)
core->scale = 1.0 - 0.9 * paint_core->cur_coords.pressure;
else if (pressure_options->size)
core->scale = paint_core->cur_coords.pressure;
else
core->scale = 1.0;
}

View file

@ -43,6 +43,7 @@
#define DEFAULT_PRESSURE_RATE FALSE
#define DEFAULT_PRESSURE_SIZE FALSE
#define DEFAULT_PRESSURE_COLOR FALSE
#define DEFAULT_PRESSURE_INVSIZE FALSE
#define DEFAULT_USE_FADE FALSE
#define DEFAULT_FADE_LENGTH 100.0
@ -66,6 +67,7 @@ enum
PROP_PRESSURE_RATE,
PROP_PRESSURE_SIZE,
PROP_PRESSURE_COLOR,
PROP_PRESSURE_INVSIZE,
PROP_USE_FADE,
PROP_FADE_LENGTH,
PROP_FADE_UNIT,
@ -173,6 +175,10 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
"pressure-color", NULL,
DEFAULT_PRESSURE_COLOR,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_PRESSURE_INVSIZE,
"pressure-invsize", NULL,
DEFAULT_PRESSURE_INVSIZE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_FADE,
"use-fade", NULL,
@ -276,6 +282,9 @@ gimp_paint_options_set_property (GObject *object,
case PROP_PRESSURE_COLOR:
pressure_options->color = g_value_get_boolean (value);
break;
case PROP_PRESSURE_INVSIZE:
pressure_options->inv_size = g_value_get_boolean (value);
break;
case PROP_USE_FADE:
fade_options->use_fade = g_value_get_boolean (value);
@ -352,6 +361,9 @@ gimp_paint_options_get_property (GObject *object,
case PROP_PRESSURE_COLOR:
g_value_set_boolean (value, pressure_options->color);
break;
case PROP_PRESSURE_INVSIZE:
g_value_set_boolean (value, pressure_options->inv_size);
break;
case PROP_USE_FADE:
g_value_set_boolean (value, fade_options->use_fade);

View file

@ -41,6 +41,7 @@ struct _GimpPressureOptions
gboolean rate;
gboolean size;
gboolean color;
gboolean inv_size;
};
struct _GimpFadeOptions

View file

@ -265,11 +265,13 @@ pressure_options_gui (GimpPressureOptions *pressure,
}
/* the size toggle */
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
tool_type == GIMP_TYPE_CLONE_TOOL ||
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
tool_type == GIMP_TYPE_ERASER_TOOL)
if ((g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
tool_type == GIMP_TYPE_CLONE_TOOL ||
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
tool_type == GIMP_TYPE_ERASER_TOOL)
&&
! g_type_is_a (tool_type, GIMP_TYPE_AIRBRUSH_TOOL))
{
button = gimp_prop_check_button_new (config, "pressure-size",
_("Size"));
@ -286,6 +288,15 @@ pressure_options_gui (GimpPressureOptions *pressure,
gtk_widget_show (button);
}
/* the inverse size toggle */
if (g_type_is_a (tool_type, GIMP_TYPE_AIRBRUSH_TOOL))
{
button = gimp_prop_check_button_new (config, "pressure-invsize",
_("Size"));
gtk_container_add (GTK_CONTAINER (wbox), button);
gtk_widget_show (button);
}
return frame;
}