app, pdb: check the real instance type to determine text, link and vector layers.
Without this, libgimp was creating raster GimpLayer objects when these had been rasterized, which only made kinda sense when the old "discard" procedures were not reversible. Yet even this was not entirely true, since it was still possible to undo, but unfortunately these objects are long lived. Once you get a GimpLayer, it won't ever change into a GimpTextLayer (or others)! So we need to have an object of the correct child type then we'll use gimp_rasterizable_is_rasterized() to decide how to make use of the object.
This commit is contained in:
parent
7d971a05c6
commit
58d84dfc2b
2 changed files with 12 additions and 18 deletions
|
|
@ -167,9 +167,8 @@ item_id_is_text_layer_invoker (GimpProcedure *procedure,
|
|||
{
|
||||
GimpItem *item = gimp_item_get_by_id (gimp, item_id);
|
||||
|
||||
text_layer = (GIMP_IS_LAYER (item) &&
|
||||
! gimp_item_is_removed (item) &&
|
||||
gimp_item_is_text_layer (item));
|
||||
text_layer = (GIMP_IS_TEXT_LAYER (item) &&
|
||||
! gimp_item_is_removed (item));
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
|
|
@ -200,9 +199,8 @@ item_id_is_vector_layer_invoker (GimpProcedure *procedure,
|
|||
{
|
||||
GimpItem *item = gimp_item_get_by_id (gimp, item_id);
|
||||
|
||||
vector_layer = (GIMP_IS_LAYER (item) &&
|
||||
! gimp_item_is_removed (item) &&
|
||||
gimp_item_is_vector_layer (item));
|
||||
vector_layer = (GIMP_IS_VECTOR_LAYER (item) &&
|
||||
! gimp_item_is_removed (item));
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
|
|
@ -264,9 +262,8 @@ item_id_is_link_layer_invoker (GimpProcedure *procedure,
|
|||
{
|
||||
GimpItem *item = gimp_item_get_by_id (gimp, item_id);
|
||||
|
||||
text_layer = (GIMP_IS_LAYER (item) &&
|
||||
! gimp_item_is_removed (item) &&
|
||||
gimp_item_is_link_layer (item));
|
||||
text_layer = (GIMP_IS_LINK_LAYER (item) &&
|
||||
! gimp_item_is_removed (item));
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
|
|
|
|||
|
|
@ -170,9 +170,8 @@ HELP
|
|||
{
|
||||
GimpItem *item = gimp_item_get_by_id (gimp, item_id);
|
||||
|
||||
text_layer = (GIMP_IS_LAYER (item) &&
|
||||
! gimp_item_is_removed (item) &&
|
||||
gimp_item_is_text_layer (item));
|
||||
text_layer = (GIMP_IS_TEXT_LAYER (item) &&
|
||||
! gimp_item_is_removed (item));
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
|
@ -206,9 +205,8 @@ HELP
|
|||
{
|
||||
GimpItem *item = gimp_item_get_by_id (gimp, item_id);
|
||||
|
||||
vector_layer = (GIMP_IS_LAYER (item) &&
|
||||
! gimp_item_is_removed (item) &&
|
||||
gimp_item_is_vector_layer (item));
|
||||
vector_layer = (GIMP_IS_VECTOR_LAYER (item) &&
|
||||
! gimp_item_is_removed (item));
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
|
@ -276,9 +274,8 @@ HELP
|
|||
{
|
||||
GimpItem *item = gimp_item_get_by_id (gimp, item_id);
|
||||
|
||||
text_layer = (GIMP_IS_LAYER (item) &&
|
||||
! gimp_item_is_removed (item) &&
|
||||
gimp_item_is_link_layer (item));
|
||||
text_layer = (GIMP_IS_LINK_LAYER (item) &&
|
||||
! gimp_item_is_removed (item));
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue