mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Always Show the tileset grid when we are in a tilemap layer (even when there is no active cel)
This commit is contained in:
parent
99b1474bdf
commit
40c4c549cd
@ -100,12 +100,11 @@ Grid Site::grid() const
|
|||||||
gfx::Rect Site::gridBounds() const
|
gfx::Rect Site::gridBounds() const
|
||||||
{
|
{
|
||||||
if (m_layer && m_layer->isTilemap()) {
|
if (m_layer && m_layer->isTilemap()) {
|
||||||
const Cel* cel = (m_layer ? m_layer->cel(m_frame): nullptr);
|
const Grid& grid = static_cast<LayerTilemap*>(m_layer)->tileset()->grid();
|
||||||
if (cel) {
|
gfx::Point offset = grid.tileOffset();
|
||||||
const Grid& grid = static_cast<LayerTilemap*>(m_layer)->tileset()->grid();
|
if (const Cel* cel = m_layer->cel(m_frame))
|
||||||
return gfx::Rect(grid.tileOffset() + cel->bounds().origin(),
|
offset += cel->bounds().origin();
|
||||||
grid.tileSize());
|
return gfx::Rect(offset, grid.tileSize());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::Rect bounds;
|
gfx::Rect bounds;
|
||||||
|
Loading…
Reference in New Issue
Block a user