Esempio n. 1
0
void UndoTransaction::cropLayer(Layer* layer, int x, int y, int w, int h, int bgcolor)
{
  if (!layer->is_image())
    return;

  if (!layer->is_background())
    bgcolor = 0;

  CelIterator it = ((LayerImage*)layer)->getCelBegin();
  CelIterator end = ((LayerImage*)layer)->getCelEnd();
  for (; it != end; ++it)
    cropCel(*it, x, y, w, h, bgcolor);
}
Esempio n. 2
0
void DocumentApi::cropLayer(Layer* layer, int x, int y, int w, int h, int bgcolor)
{
  if (!layer->isImage())
    return;

  if (!layer->isBackground())
    bgcolor = 0;

  Sprite* sprite = layer->getSprite();
  CelIterator it = ((LayerImage*)layer)->getCelBegin();
  CelIterator end = ((LayerImage*)layer)->getCelEnd();
  for (; it != end; ++it)
    cropCel(sprite, *it, x, y, w, h, bgcolor);
}