added #defines for GimpCoords' default pressure, tilt and wheel values.

2004-02-23  Michael Natterer  <mitch@gimp.org>

	* app/core/core-types.h: added #defines for GimpCoords' default
	pressure, tilt and wheel values.

	* app/display/gimpdisplayshell-callbacks.c
	* app/paint/gimppaintcore-stroke.c
	* app/text/gimptext-vectors.c
	* tools/pdbgen/pdb/paint_tools.pdb: use them. Fixes lots more
	buggy default values for tilt (in fact all of them were wrong).

	* app/pdb/paint_tools_cmds.c: regenerated.
This commit is contained in:
Michael Natterer 2004-02-23 22:36:50 +00:00 committed by Michael Natterer
parent 8b18fc8547
commit eb7f99bb8f
7 changed files with 51 additions and 34 deletions

View File

@ -1,3 +1,16 @@
2004-02-23 Michael Natterer <mitch@gimp.org>
* app/core/core-types.h: added #defines for GimpCoords' default
pressure, tilt and wheel values.
* app/display/gimpdisplayshell-callbacks.c
* app/paint/gimppaintcore-stroke.c
* app/text/gimptext-vectors.c
* tools/pdbgen/pdb/paint_tools.pdb: use them. Fixes lots more
buggy default values for tilt (in fact all of them were wrong).
* app/pdb/paint_tools_cmds.c: regenerated.
2004-02-23 Simon Budig <simon@gimp.org>
* app/display/gimpdisplayshell-callbacks.c: corrected the

View File

@ -31,8 +31,12 @@
/* defines */
#define GIMP_OPACITY_TRANSPARENT 0.0
#define GIMP_OPACITY_OPAQUE 1.0
#define GIMP_OPACITY_TRANSPARENT 0.0
#define GIMP_OPACITY_OPAQUE 1.0
#define GIMP_COORDS_DEFAULT_PRESSURE 1.0
#define GIMP_COORDS_DEFAULT_TILT 0.0
#define GIMP_COORDS_DEFAULT_WHEEL 0.5
/* enums */

View File

@ -1545,22 +1545,22 @@ gimp_display_shell_get_event_coords (GimpDisplayShell *shell,
if (gdk_event_get_axis (event, GDK_AXIS_PRESSURE, &coords->pressure))
coords->pressure = CLAMP (coords->pressure, 0.0, 1.0);
else
coords->pressure = 1.0;
coords->pressure = GIMP_COORDS_DEFAULT_PRESSURE;
if (gdk_event_get_axis (event, GDK_AXIS_XTILT, &coords->xtilt))
coords->xtilt = CLAMP (coords->xtilt, -1.0, 1.0);
else
coords->xtilt = 0.0;
coords->xtilt = GIMP_COORDS_DEFAULT_TILT;
if (gdk_event_get_axis (event, GDK_AXIS_YTILT, &coords->ytilt))
coords->ytilt = CLAMP (coords->ytilt, -1.0, 1.0);
else
coords->ytilt = 0.0;
coords->ytilt = GIMP_COORDS_DEFAULT_TILT;
if (gdk_event_get_axis (event, GDK_AXIS_WHEEL, &coords->wheel))
coords->wheel = CLAMP (coords->wheel, 0.0, 1.0);
else
coords->wheel = 0.5;
coords->wheel = GIMP_COORDS_DEFAULT_WHEEL;
return TRUE;
}
@ -1590,22 +1590,22 @@ gimp_display_shell_get_device_coords (GimpDisplayShell *shell,
if (gdk_device_get_axis (device, axes, GDK_AXIS_PRESSURE, &coords->pressure))
coords->pressure = CLAMP (coords->pressure, 0.0, 1.0);
else
coords->pressure = 1.0;
coords->pressure = GIMP_COORDS_DEFAULT_PRESSURE;
if (gdk_device_get_axis (device, axes, GDK_AXIS_XTILT, &coords->xtilt))
coords->xtilt = CLAMP (coords->xtilt, -1.0, 1.0);
else
coords->xtilt = 0.0;
coords->xtilt = GIMP_COORDS_DEFAULT_TILT;
if (gdk_device_get_axis (device, axes, GDK_AXIS_YTILT, &coords->ytilt))
coords->ytilt = CLAMP (coords->ytilt, -1.0, 1.0);
else
coords->ytilt = 0.0;
coords->ytilt = GIMP_COORDS_DEFAULT_TILT;
if (gdk_device_get_axis (device, axes, GDK_AXIS_WHEEL, &coords->wheel))
coords->wheel = CLAMP (coords->wheel, 0.0, 1.0);
else
coords->wheel = 0.5;
coords->wheel = GIMP_COORDS_DEFAULT_WHEEL;
}
static gboolean

View File

@ -126,10 +126,10 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
coords[n_coords].x = (gdouble) (stroke_segs[0].x1 - off_x + 0.5);
coords[n_coords].y = (gdouble) (stroke_segs[0].y1 - off_y + 0.5);
coords[n_coords].pressure = 1.0;
coords[n_coords].xtilt = 0.5;
coords[n_coords].ytilt = 0.5;
coords[n_coords].wheel = 0.5;
coords[n_coords].pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coords[n_coords].xtilt = GIMP_COORDS_DEFAULT_TILT;
coords[n_coords].ytilt = GIMP_COORDS_DEFAULT_TILT;
coords[n_coords].wheel = GIMP_COORDS_DEFAULT_WHEEL;
n_coords++;
@ -146,10 +146,10 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
off_x + 0.5);
coords[n_coords].y = (gdouble) (stroke_segs[seg].y1 -
off_y + 0.5);
coords[n_coords].pressure = 1.0;
coords[n_coords].xtilt = 0.5;
coords[n_coords].ytilt = 0.5;
coords[n_coords].wheel = 0.5;
coords[n_coords].pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coords[n_coords].xtilt = GIMP_COORDS_DEFAULT_TILT;
coords[n_coords].ytilt = GIMP_COORDS_DEFAULT_TILT;
coords[n_coords].wheel = GIMP_COORDS_DEFAULT_WHEEL;
n_coords++;
seg++;
@ -191,10 +191,10 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
coords[n_coords].x = (gdouble) (stroke_segs[seg].x1 - off_x + 0.5);
coords[n_coords].y = (gdouble) (stroke_segs[seg].y1 - off_y + 0.5);
coords[n_coords].pressure = 1.0;
coords[n_coords].xtilt = 0.5;
coords[n_coords].ytilt = 0.5;
coords[n_coords].wheel = 0.5;
coords[n_coords].pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coords[n_coords].xtilt = GIMP_COORDS_DEFAULT_TILT;
coords[n_coords].ytilt = GIMP_COORDS_DEFAULT_TILT;
coords[n_coords].wheel = GIMP_COORDS_DEFAULT_WHEEL;
n_coords++;
}

View File

@ -116,10 +116,10 @@ paint_tools_stroke (Gimp *gimp,
{
coords[i].x = strokes[2 * i];
coords[i].y = strokes[2 * i + 1];
coords[i].pressure = 1.0;
coords[i].xtilt = 0.5;
coords[i].ytilt = 0.5;
coords[i].wheel = 0.5;
coords[i].pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coords[i].xtilt = GIMP_COORDS_DEFAULT_TILT;
coords[i].ytilt = GIMP_COORDS_DEFAULT_TILT;
coords[i].wheel = GIMP_COORDS_DEFAULT_WHEEL;
}
retval = gimp_paint_core_stroke (core, drawable, options,

View File

@ -112,10 +112,10 @@ gimp_text_vector_coords (RenderContext *context,
{
coords->x = context->offset_x + (gdouble) vector->x / 64.0;
coords->y = context->offset_y - (gdouble) vector->y / 64.0;
coords->pressure = 1.0;
coords->xtilt = 0.5;
coords->ytilt = 0.5;
coords->wheel = 0.5;
coords->pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coords->xtilt = GIMP_COORDS_DEFAULT_TILT;
coords->ytilt = GIMP_COORDS_DEFAULT_TILT;
coords->wheel = GIMP_COORDS_DEFAULT_WHEEL;
}
static gint

View File

@ -774,10 +774,10 @@ paint_tools_stroke (Gimp *gimp,
{
coords[i].x = strokes[2 * i];
coords[i].y = strokes[2 * i + 1];
coords[i].pressure = 1.0;
coords[i].xtilt = 0.5;
coords[i].ytilt = 0.5;
coords[i].wheel = 0.5;
coords[i].pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coords[i].xtilt = GIMP_COORDS_DEFAULT_TILT;
coords[i].ytilt = GIMP_COORDS_DEFAULT_TILT;
coords[i].wheel = GIMP_COORDS_DEFAULT_WHEEL;
}
retval = gimp_paint_core_stroke (core, drawable, options,