Fix PF_LAYER always being passed as a Layer, even if object is a LayerGroup
This commit is contained in:
@ -1904,14 +1904,20 @@ pygimp_layer_new(gint32 ID)
|
||||
PyGimpLayer *self;
|
||||
|
||||
if (!gimp_item_is_valid(ID) || !gimp_item_is_layer(ID)) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
self = PyObject_NEW(PyGimpLayer, &PyGimpLayer_Type);
|
||||
|
||||
if (gimp_item_is_group(ID)) {
|
||||
self = PyObject_NEW(PyGimpGroupLayer, &PyGimpGroupLayer_Type);
|
||||
}
|
||||
else {
|
||||
self = PyObject_NEW(PyGimpLayer, &PyGimpLayer_Type);
|
||||
}
|
||||
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
self->ID = ID;
|
||||
self->drawable = NULL;
|
||||
|
Reference in New Issue
Block a user