Add Sprite::first/lastLayer() member functions

This commit is contained in:
David Capello 2015-02-04 08:19:02 -03:00
parent 1321de9d58
commit e975d1c710
2 changed files with 12 additions and 0 deletions

View File

@ -208,6 +208,16 @@ LayerIndex Sprite::countLayers() const
return LayerIndex(folder()->getLayersCount());
}
LayerIndex Sprite::firstLayer() const
{
return LayerIndex(0);
}
LayerIndex Sprite::lastLayer() const
{
return LayerIndex(folder()->getLayersCount()-1);
}
Layer* Sprite::layer(int layerIndex) const
{
return indexToLayer(LayerIndex(layerIndex));

View File

@ -78,6 +78,8 @@ namespace doc {
LayerImage* backgroundLayer() const;
LayerIndex countLayers() const;
LayerIndex firstLayer() const;
LayerIndex lastLayer() const;
Layer* layer(int layerIndex) const;
Layer* indexToLayer(LayerIndex index) const;