Fix PF_LAYER always being passed as a Layer, even if object is a LayerGroup

This commit is contained in:
Joao S. O. Bueno
2015-02-10 11:55:30 -02:00
parent 678b61a3ac
commit 59417ca4b6

View File

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