mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +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
|
||||
{
|
||||
if (m_layer && m_layer->isTilemap()) {
|
||||
const Cel* cel = (m_layer ? m_layer->cel(m_frame): nullptr);
|
||||
if (cel) {
|
||||
const Grid& grid = static_cast<LayerTilemap*>(m_layer)->tileset()->grid();
|
||||
return gfx::Rect(grid.tileOffset() + cel->bounds().origin(),
|
||||
grid.tileSize());
|
||||
}
|
||||
const Grid& grid = static_cast<LayerTilemap*>(m_layer)->tileset()->grid();
|
||||
gfx::Point offset = grid.tileOffset();
|
||||
if (const Cel* cel = m_layer->cel(m_frame))
|
||||
offset += cel->bounds().origin();
|
||||
return gfx::Rect(offset, grid.tileSize());
|
||||
}
|
||||
|
||||
gfx::Rect bounds;
|
||||
|
Loading…
Reference in New Issue
Block a user