mirror of https://github.com/GNOME/gimp.git
scripts: Fix "Remove all Guides" script bug
Resolves #10651 The "Remove All Guides" script calls gimp-image-find-next-guide, which per its description can take in 0. However, the parameter sets 1 as the minimum value. This patch fixes the range so that it can accept 0, which enables the Remove All Guides script to work again. It also updates the script to the new multi-layer aware API.
This commit is contained in:
parent
14abb71c34
commit
21d24467ad
|
@ -163,11 +163,11 @@ image_find_next_guide_invoker (GimpProcedure *procedure,
|
||||||
gboolean success = TRUE;
|
gboolean success = TRUE;
|
||||||
GimpValueArray *return_vals;
|
GimpValueArray *return_vals;
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
guint guide;
|
gint guide;
|
||||||
guint next_guide = 0;
|
guint next_guide = 0;
|
||||||
|
|
||||||
image = g_value_get_object (gimp_value_array_index (args, 0));
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
||||||
guide = g_value_get_uint (gimp_value_array_index (args, 1));
|
guide = g_value_get_int (gimp_value_array_index (args, 1));
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
|
@ -390,11 +390,11 @@ register_image_guides_procs (GimpPDB *pdb)
|
||||||
FALSE,
|
FALSE,
|
||||||
GIMP_PARAM_READWRITE));
|
GIMP_PARAM_READWRITE));
|
||||||
gimp_procedure_add_argument (procedure,
|
gimp_procedure_add_argument (procedure,
|
||||||
g_param_spec_uint ("guide",
|
g_param_spec_int ("guide",
|
||||||
"guide",
|
"guide",
|
||||||
"The ID of the current guide (0 if first invocation)",
|
"The ID of the current guide (0 if first invocation)",
|
||||||
1, G_MAXUINT32, 1,
|
0, G_MAXINT32, 1,
|
||||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||||
gimp_procedure_add_return_value (procedure,
|
gimp_procedure_add_return_value (procedure,
|
||||||
g_param_spec_uint ("next-guide",
|
g_param_spec_uint ("next-guide",
|
||||||
"next guide",
|
"next guide",
|
||||||
|
|
|
@ -168,7 +168,7 @@ gimp_image_delete_guide (GimpImage *image,
|
||||||
**/
|
**/
|
||||||
guint
|
guint
|
||||||
gimp_image_find_next_guide (GimpImage *image,
|
gimp_image_find_next_guide (GimpImage *image,
|
||||||
guint guide)
|
gint guide)
|
||||||
{
|
{
|
||||||
GimpValueArray *args;
|
GimpValueArray *args;
|
||||||
GimpValueArray *return_vals;
|
GimpValueArray *return_vals;
|
||||||
|
@ -176,7 +176,7 @@ gimp_image_find_next_guide (GimpImage *image,
|
||||||
|
|
||||||
args = gimp_value_array_new_from_types (NULL,
|
args = gimp_value_array_new_from_types (NULL,
|
||||||
GIMP_TYPE_IMAGE, image,
|
GIMP_TYPE_IMAGE, image,
|
||||||
G_TYPE_UINT, guide,
|
G_TYPE_INT, guide,
|
||||||
G_TYPE_NONE);
|
G_TYPE_NONE);
|
||||||
|
|
||||||
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
||||||
|
|
|
@ -39,7 +39,7 @@ guint gimp_image_add_vguide (GimpImage *image,
|
||||||
gboolean gimp_image_delete_guide (GimpImage *image,
|
gboolean gimp_image_delete_guide (GimpImage *image,
|
||||||
guint guide);
|
guint guide);
|
||||||
guint gimp_image_find_next_guide (GimpImage *image,
|
guint gimp_image_find_next_guide (GimpImage *image,
|
||||||
guint guide);
|
gint guide);
|
||||||
GimpOrientationType gimp_image_get_guide_orientation (GimpImage *image,
|
GimpOrientationType gimp_image_get_guide_orientation (GimpImage *image,
|
||||||
guint guide);
|
guint guide);
|
||||||
gint gimp_image_get_guide_position (GimpImage *image,
|
gint gimp_image_get_guide_position (GimpImage *image,
|
||||||
|
|
|
@ -142,7 +142,7 @@ HELP
|
||||||
@inargs = (
|
@inargs = (
|
||||||
{ name => 'image', type => 'image',
|
{ name => 'image', type => 'image',
|
||||||
desc => 'The image' },
|
desc => 'The image' },
|
||||||
{ name => 'guide', type => 'guide', no_validate => 1,
|
{ name => 'guide', type => '0 <= int32', default => 1, no_validate => 1,
|
||||||
desc => 'The ID of the current guide (0 if first invocation)' }
|
desc => 'The ID of the current guide (0 if first invocation)' }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;; -*-scheme-*-
|
;; -*-scheme-*-
|
||||||
|
|
||||||
(define (script-fu-guides-remove image drawable)
|
(define (script-fu-guides-remove image drawables)
|
||||||
(let* ((guide-id 0))
|
(let* ((guide-id 0))
|
||||||
(gimp-image-undo-group-start image)
|
(gimp-image-undo-group-start image)
|
||||||
|
|
||||||
|
@ -15,15 +15,14 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(script-fu-register "script-fu-guides-remove"
|
(script-fu-register-filter "script-fu-guides-remove"
|
||||||
_"_Remove all Guides"
|
_"_Remove all Guides"
|
||||||
_"Remove all horizontal and vertical guides"
|
_"Remove all horizontal and vertical guides"
|
||||||
"Alan Horkan"
|
"Alan Horkan"
|
||||||
"Alan Horkan, 2004. Public Domain."
|
"Alan Horkan, 2004. Public Domain."
|
||||||
"April 2004"
|
"April 2004"
|
||||||
"*"
|
"*"
|
||||||
SF-IMAGE "Image" 0
|
SF-ONE-OR-MORE-DRAWABLE
|
||||||
SF-DRAWABLE "Drawable" 0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(script-fu-menu-register "script-fu-guides-remove"
|
(script-fu-menu-register "script-fu-guides-remove"
|
||||||
|
|
Loading…
Reference in New Issue