From 13e2823a0339ad78f61c236067d036ca034a7630 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Fri, 3 Apr 2026 10:58:10 +0000 Subject: [PATCH] pdb: Allow pixels as unit in PDB calls In GIMP 2.10, the PDB call gimp-context-set-line-width-unit allowed for Pixels to be set as a unit. In 3.0, we changed GimpUnit to be a proper object and gave it options to allow pixels or not. The default setting is 'no pixels allowed', which caused the unchanged gimp-context-set-line-width-unit parameter to no longer accept pixels as a unit. This patch adds `allow_pixel => 1` to the PDB set-up for setting units to fix this oversight. --- app/pdb/context-cmds.c | 2 +- app/pdb/vector-layer-cmds.c | 2 +- pdb/groups/context.pdb | 2 +- pdb/groups/vector_layer.pdb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/pdb/context-cmds.c b/app/pdb/context-cmds.c index 9b6877a2ae..ec2a34d61b 100644 --- a/app/pdb/context-cmds.c +++ b/app/pdb/context-cmds.c @@ -3735,7 +3735,7 @@ register_context_procs (GimpPDB *pdb) gimp_param_spec_unit ("line-width-unit", "line width unit", "The line width setting unit", - FALSE, + TRUE, FALSE, gimp_unit_inch (), GIMP_PARAM_READWRITE)); diff --git a/app/pdb/vector-layer-cmds.c b/app/pdb/vector-layer-cmds.c index b753cd2129..cc20a59a56 100644 --- a/app/pdb/vector-layer-cmds.c +++ b/app/pdb/vector-layer-cmds.c @@ -1851,7 +1851,7 @@ register_vector_layer_procs (GimpPDB *pdb) gimp_param_spec_unit ("unit", "unit", "The stroke width unit.", - FALSE, + TRUE, FALSE, gimp_unit_inch (), GIMP_PARAM_READWRITE)); diff --git a/pdb/groups/context.pdb b/pdb/groups/context.pdb index 968d19f960..9980c8cded 100644 --- a/pdb/groups/context.pdb +++ b/pdb/groups/context.pdb @@ -584,7 +584,7 @@ HELP &mitch_pdb_misc('2015', '2.10'); @inargs = ( - { name => 'line_width_unit', type => 'unit', + { name => 'line_width_unit', type => 'unit', allow_pixel => 1, desc => 'The line width setting unit' } ); diff --git a/pdb/groups/vector_layer.pdb b/pdb/groups/vector_layer.pdb index 074a77ab52..7b87dcacf0 100644 --- a/pdb/groups/vector_layer.pdb +++ b/pdb/groups/vector_layer.pdb @@ -630,7 +630,7 @@ HELP @inargs = ( { name => 'layer', type => 'vector_layer', desc => 'The vector layer.' }, - { name => 'unit', type => 'unit', + { name => 'unit', type => 'unit', allow_pixel => 1, desc => 'The stroke width unit.' } );