pdb: Use floating point offset in stroke_translate

Update gimp_vectors_stroke_translate () to accept
floating point values for offset parameters
like gimp_stroke_translate () does.
This commit is contained in:
Alx Sa 2022-10-07 01:40:26 +00:00
parent 4b4dd5ec38
commit b317eceda9
4 changed files with 23 additions and 23 deletions

View File

@ -429,13 +429,13 @@ vectors_stroke_translate_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpVectors *vectors;
gint stroke_id;
gint off_x;
gint off_y;
gdouble off_x;
gdouble off_y;
vectors = g_value_get_object (gimp_value_array_index (args, 0));
stroke_id = g_value_get_int (gimp_value_array_index (args, 1));
off_x = g_value_get_int (gimp_value_array_index (args, 2));
off_y = g_value_get_int (gimp_value_array_index (args, 3));
off_x = g_value_get_double (gimp_value_array_index (args, 2));
off_y = g_value_get_double (gimp_value_array_index (args, 3));
if (success)
{
@ -1692,17 +1692,17 @@ register_vectors_procs (GimpPDB *pdb)
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_int ("off-x",
"off x",
"Offset in x direction",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
g_param_spec_double ("off-x",
"off x",
"Offset in x direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_int ("off-y",
"off y",
"Offset in y direction",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
g_param_spec_double ("off-y",
"off y",
"Offset in y direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);

View File

@ -444,8 +444,8 @@ gimp_vectors_stroke_reverse (GimpVectors *vectors,
gboolean
gimp_vectors_stroke_translate (GimpVectors *vectors,
gint stroke_id,
gint off_x,
gint off_y)
gdouble off_x,
gdouble off_y)
{
GimpValueArray *args;
GimpValueArray *return_vals;
@ -454,8 +454,8 @@ gimp_vectors_stroke_translate (GimpVectors *vectors,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
G_TYPE_INT, off_x,
G_TYPE_INT, off_y,
G_TYPE_DOUBLE, off_x,
G_TYPE_DOUBLE, off_y,
G_TYPE_NONE);
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),

View File

@ -58,8 +58,8 @@ gboolean gimp_vectors_stroke_reverse (GimpVectors
gint stroke_id);
gboolean gimp_vectors_stroke_translate (GimpVectors *vectors,
gint stroke_id,
gint off_x,
gint off_y);
gdouble off_x,
gdouble off_y);
gboolean gimp_vectors_stroke_scale (GimpVectors *vectors,
gint stroke_id,
gdouble scale_x,

View File

@ -392,9 +392,9 @@ HELP
desc => 'The vectors object' },
{ name => 'stroke_id', type => 'int32',
desc => 'The stroke ID' },
{ name => "off_x", type => 'int32',
{ name => "off_x", type => 'float',
desc => "Offset in x direction" },
{ name => "off_y", type => 'int32',
{ name => "off_y", type => 'float',
desc => "Offset in y direction" }
);
@ -1333,7 +1333,7 @@ CODE
@procs = qw(vectors_new
vectors_new_from_text_layer
vectors_copy
vectors_get_strokes
vectors_get_strokes
vectors_stroke_get_length
vectors_stroke_get_point_at_dist
vectors_remove_stroke