| 1 | // Aseprite |
|---|---|
| 2 | // Copyright (C) 2001-2015 David Capello |
| 3 | // |
| 4 | // This program is distributed under the terms of |
| 5 | // the End-User License Agreement for Aseprite. |
| 6 | |
| 7 | #ifdef HAVE_CONFIG_H |
| 8 | #include "config.h" |
| 9 | #endif |
| 10 | |
| 11 | #include "app/cmd/with_layer.h" |
| 12 | |
| 13 | #include "doc/layer.h" |
| 14 | |
| 15 | namespace app { |
| 16 | namespace cmd { |
| 17 | |
| 18 | using namespace doc; |
| 19 | |
| 20 | WithLayer::WithLayer(Layer* layer) |
| 21 | : m_layerId(layer ? layer->id(): 0) |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | Layer* WithLayer::layer() |
| 26 | { |
| 27 | if (m_layerId) |
| 28 | return get<Layer>(m_layerId); |
| 29 | else |
| 30 | return nullptr; |
| 31 | } |
| 32 | |
| 33 | } // namespace cmd |
| 34 | } // namespace app |
| 35 |