pdb: never pass bogus supersample values to gimp_drawable_gradient()
even when supersampling is not enabled, or we will get warnings about out-of-range property values.
This commit is contained in:
@ -228,14 +228,22 @@ drawable_edit_gradient_fill_invoker (GimpProcedure *procedure,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
|
||||
|
||||
if (success && supersample)
|
||||
if (success)
|
||||
{
|
||||
if (supersample_max_depth < 1 || supersample_max_depth > 9)
|
||||
success = FALSE;
|
||||
if (supersample)
|
||||
{
|
||||
if (supersample_max_depth < 1 || supersample_max_depth > 9)
|
||||
success = FALSE;
|
||||
|
||||
if (supersample_threshold < 0.0 || supersample_threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
if (supersample_threshold < 0.0 || supersample_threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
supersample_max_depth = CLAMP (supersample_max_depth, 1, 9);
|
||||
supersample_threshold = CLAMP (supersample_threshold, 0.0, 4.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
|
@ -777,13 +777,21 @@ edit_blend_invoker (GimpProcedure *procedure,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
|
||||
|
||||
if (success && supersample)
|
||||
if (success)
|
||||
{
|
||||
if (max_depth < 1 || max_depth > 9)
|
||||
success = FALSE;
|
||||
if (supersample)
|
||||
{
|
||||
if (max_depth < 1 || max_depth > 9)
|
||||
success = FALSE;
|
||||
|
||||
if (threshold < 0.0 || threshold > 4.0)
|
||||
success = FALSE;
|
||||
if (threshold < 0.0 || threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
max_depth = CLAMP (max_depth, 1, 9);
|
||||
threshold = CLAMP (threshold, 0.0, 4.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
|
@ -247,14 +247,22 @@ HELP
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
|
||||
|
||||
if (success && supersample)
|
||||
if (success)
|
||||
{
|
||||
if (supersample_max_depth < 1 || supersample_max_depth > 9)
|
||||
success = FALSE;
|
||||
if (supersample)
|
||||
{
|
||||
if (supersample_max_depth < 1 || supersample_max_depth > 9)
|
||||
success = FALSE;
|
||||
|
||||
if (supersample_threshold < 0.0 || supersample_threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
if (supersample_threshold < 0.0 || supersample_threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
supersample_max_depth = CLAMP (supersample_max_depth, 1, 9);
|
||||
supersample_threshold = CLAMP (supersample_threshold, 0.0, 4.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
|
@ -869,13 +869,21 @@ HELP
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
|
||||
|
||||
if (success && supersample)
|
||||
if (success)
|
||||
{
|
||||
if (max_depth < 1 || max_depth > 9)
|
||||
success = FALSE;
|
||||
if (supersample)
|
||||
{
|
||||
if (max_depth < 1 || max_depth > 9)
|
||||
success = FALSE;
|
||||
|
||||
if (threshold < 0.0 || threshold > 4.0)
|
||||
success = FALSE;
|
||||
if (threshold < 0.0 || threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
max_depth = CLAMP (max_depth, 1, 9);
|
||||
threshold = CLAMP (threshold, 0.0, 4.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
|
Reference in New Issue
Block a user