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.
This commit is contained in:
Alx Sa 2026-04-03 10:58:10 +00:00
parent 65e06ab42b
commit 13e2823a03
4 changed files with 4 additions and 4 deletions

View file

@ -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));

View file

@ -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));

View file

@ -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' }
);

View file

@ -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.' }
);