mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-09 07:13:43 +00:00
Show current grid tile in status bar when the grid is visible (fix #1075)
This commit is contained in:
parent
fcca96d6a3
commit
33003fb6f9
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@ -410,6 +410,7 @@
|
||||
<part id="icon_angle" x="200" y="264" w="8" h="8" />
|
||||
<part id="icon_key" x="208" y="264" w="8" h="8" />
|
||||
<part id="icon_distance" x="216" y="264" w="8" h="8" />
|
||||
<part id="icon_grid" x="224" y="264" w="8" h="8" />
|
||||
</parts>
|
||||
|
||||
<stylesheet>
|
||||
|
@ -462,6 +462,7 @@ bool StandbyState::onUpdateStatusBar(Editor* editor)
|
||||
(mask ? "selsize": "size"),
|
||||
(mask ? mask->bounds().w: sprite->width()),
|
||||
(mask ? mask->bounds().h: sprite->height()));
|
||||
|
||||
if (sprite->totalFrames() > 1) {
|
||||
sprintf(
|
||||
buf+std::strlen(buf), " :frame: %d :clock: %d",
|
||||
@ -469,6 +470,14 @@ bool StandbyState::onUpdateStatusBar(Editor* editor)
|
||||
sprite->frameDuration(editor->frame()));
|
||||
}
|
||||
|
||||
if (editor->docPref().show.grid()) {
|
||||
auto gb = editor->docPref().grid.bounds();
|
||||
int col = (spritePos.x - (gb.x % gb.w)) / gb.w;
|
||||
int row = (spritePos.y - (gb.y % gb.h)) / gb.h;
|
||||
sprintf(
|
||||
buf+std::strlen(buf), " :grid: %d %d", col, row);
|
||||
}
|
||||
|
||||
StatusBar::instance()->setStatusText(0, buf);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user