mirror of https://github.com/aseprite/aseprite.git
Show grid cell index in status bar (#2082)
This commit is contained in:
parent
951c2d0de9
commit
ebd17b0ced
|
@ -610,6 +610,18 @@ bool StandbyState::onUpdateStatusBar(Editor* editor)
|
||||||
buf += fmt::format(" [{}{}]", ti, str);
|
buf += fmt::format(" [{}{}]", ti, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Show the grid cell index
|
||||||
|
if (sprite->bounds().contains(gfx::Point(spritePos))) {
|
||||||
|
int columns = int(std::floor(
|
||||||
|
sprite->bounds().w/grid.tileSize().w));
|
||||||
|
int rows = int(std::floor(
|
||||||
|
sprite->bounds().h/grid.tileSize().h));
|
||||||
|
int column = (columns ? pt.x%columns: 0);
|
||||||
|
int row = (rows ? pt.y%rows: 0);
|
||||||
|
if (row < 0) row = row + rows;
|
||||||
|
if (column < 0) column = column + columns;
|
||||||
|
buf += fmt::format(" :search: {}", column+row*columns);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue