Commit 336de793 authored by Alexia Death's avatar Alexia Death

app: Add dynamics to airbrush Flow

parent f1a1114e
......@@ -1316,6 +1316,7 @@ gimp_dynamics_output_type_get_type (void)
{ GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO, "GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO", "aspect-ratio" },
{ GIMP_DYNAMICS_OUTPUT_SPACING, "GIMP_DYNAMICS_OUTPUT_SPACING", "spacing" },
{ GIMP_DYNAMICS_OUTPUT_RATE, "GIMP_DYNAMICS_OUTPUT_RATE", "rate" },
{ GIMP_DYNAMICS_OUTPUT_FLOW, "GIMP_DYNAMICS_OUTPUT_FLOW", "flow" },
{ GIMP_DYNAMICS_OUTPUT_JITTER, "GIMP_DYNAMICS_OUTPUT_JITTER", "jitter" },
{ 0, NULL, NULL }
};
......@@ -1330,6 +1331,7 @@ gimp_dynamics_output_type_get_type (void)
{ GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO, NC_("dynamics-output-type", "Aspect ratio"), NULL },
{ GIMP_DYNAMICS_OUTPUT_SPACING, NC_("dynamics-output-type", "Spacing"), NULL },
{ GIMP_DYNAMICS_OUTPUT_RATE, NC_("dynamics-output-type", "Rate"), NULL },
{ GIMP_DYNAMICS_OUTPUT_FLOW, NC_("dynamics-output-type", "Flow"), NULL },
{ GIMP_DYNAMICS_OUTPUT_JITTER, NC_("dynamics-output-type", "Jitter"), NULL },
{ 0, NULL, NULL }
};
......
......@@ -598,6 +598,7 @@ typedef enum /*< pdb-skip >*/
GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO, /*< desc="Aspect ratio" >*/
GIMP_DYNAMICS_OUTPUT_SPACING, /*< desc="Spacing" >*/
GIMP_DYNAMICS_OUTPUT_RATE, /*< desc="Rate" >*/
GIMP_DYNAMICS_OUTPUT_FLOW, /*< desc="Flow" >*/
GIMP_DYNAMICS_OUTPUT_JITTER, /*< desc="Jitter" >*/
} GimpDynamicsOutputType;
......
......@@ -49,6 +49,7 @@ enum
PROP_ASPECT_RATIO_OUTPUT,
PROP_SPACING_OUTPUT,
PROP_RATE_OUTPUT,
PROP_FLOW_OUTPUT,
PROP_JITTER_OUTPUT
};
......@@ -118,6 +119,11 @@ gimp_dynamics_class_init (GimpDynamicsClass *klass)
GIMP_TYPE_DYNAMICS_OUTPUT,
GIMP_CONFIG_PARAM_AGGREGATE);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_FLOW_OUTPUT,
"flow-output", NULL,
GIMP_TYPE_DYNAMICS_OUTPUT,
GIMP_CONFIG_PARAM_AGGREGATE);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_SIZE_OUTPUT,
"size-output", NULL,
GIMP_TYPE_DYNAMICS_OUTPUT,
......@@ -161,6 +167,9 @@ gimp_dynamics_init (GimpDynamics *dynamics)
dynamics->rate_output = gimp_dynamics_create_output (dynamics,
"rate-output",
GIMP_DYNAMICS_OUTPUT_RATE);
dynamics->flow_output = gimp_dynamics_create_output (dynamics,
"flow-output",
GIMP_DYNAMICS_OUTPUT_RATE);
dynamics->size_output = gimp_dynamics_create_output (dynamics,
"size-output",
GIMP_DYNAMICS_OUTPUT_SIZE);
......@@ -189,6 +198,7 @@ gimp_dynamics_finalize (GObject *object)
g_object_unref (dynamics->opacity_output);
g_object_unref (dynamics->hardness_output);
g_object_unref (dynamics->rate_output);
g_object_unref (dynamics->flow_output);
g_object_unref (dynamics->size_output);
g_object_unref (dynamics->aspect_ratio_output);
g_object_unref (dynamics->color_output);
......@@ -230,6 +240,11 @@ gimp_dynamics_set_property (GObject *object,
dest_output = dynamics->rate_output;
break;
case PROP_FLOW_OUTPUT:
src_output = g_value_get_object (value);
dest_output = dynamics->flow_output;
break;
case PROP_SIZE_OUTPUT:
src_output = g_value_get_object (value);
dest_output = dynamics->size_output;
......@@ -299,6 +314,10 @@ gimp_dynamics_get_property (GObject *object,
g_value_set_object (value, dynamics->rate_output);
break;
case PROP_FLOW_OUTPUT:
g_value_set_object (value, dynamics->flow_output);
break;
case PROP_SIZE_OUTPUT:
g_value_set_object (value, dynamics->size_output);
break;
......@@ -403,6 +422,10 @@ gimp_dynamics_get_output (GimpDynamics *dynamics,
return dynamics->rate_output;
break;
case GIMP_DYNAMICS_OUTPUT_FLOW:
return dynamics->flow_output;
break;
case GIMP_DYNAMICS_OUTPUT_SIZE:
return dynamics->size_output;
break;
......
......@@ -39,6 +39,7 @@ struct _GimpDynamics
GimpDynamicsOutput *opacity_output;
GimpDynamicsOutput *hardness_output;
GimpDynamicsOutput *rate_output;
GimpDynamicsOutput *flow_output;
GimpDynamicsOutput *size_output;
GimpDynamicsOutput *aspect_ratio_output;
GimpDynamicsOutput *color_output;
......
......@@ -197,7 +197,7 @@ gimp_airbrush_motion (GimpPaintCore *paint_core,
fade_point = gimp_paint_options_get_fade (paint_options, image,
paint_core->pixel_dist);
opacity = options->flow / 100.0;
opacity *= gimp_dynamics_output_get_linear_value(GIMP_BRUSH_CORE(paint_core)->dynamics->opacity_output,
opacity *= gimp_dynamics_output_get_linear_value(GIMP_BRUSH_CORE(paint_core)->dynamics->flow_output,
coords,
paint_options,
fade_point);
......
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