Add 1x1 background grid

From:
https://community.aseprite.org/t/change-background-checkerboard-grid-size/390/2
This commit is contained in:
David Capello 2017-09-05 14:38:42 -03:00
parent f223d157fd
commit 86e14fa2ff
3 changed files with 9 additions and 1 deletions

View File

@ -32,6 +32,7 @@
<value id="CHECKED_8x8" value="1" />
<value id="CHECKED_4x4" value="2" />
<value id="CHECKED_2x2" value="3" />
<value id="CHECKED_1x1" value="4" />
</enum>
<enum id="StopAtGrid">
<value id="NEVER" value="0" />

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2015 David Capello
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -48,6 +48,10 @@ void AppRender::setupBackground(app::Document* doc, doc::PixelFormat pixelFormat
bgType = render::BgType::CHECKED;
tile = gfx::Size(2, 2);
break;
case app::gen::BgType::CHECKED_1x1:
bgType = render::BgType::CHECKED;
tile = gfx::Size(1, 1);
break;
default:
bgType = render::BgType::TRANSPARENT;
break;

View File

@ -289,10 +289,13 @@ public:
#endif
// Checked background size
static_assert(int(app::gen::BgType::CHECKED_16x16) == 0, "");
static_assert(int(app::gen::BgType::CHECKED_1x1) == 4, "");
checkedBgSize()->addItem("16x16");
checkedBgSize()->addItem("8x8");
checkedBgSize()->addItem("4x4");
checkedBgSize()->addItem("2x2");
checkedBgSize()->addItem("1x1");
// Reset buttons
resetBg()->Click.connect(base::Bind<void>(&OptionsWindow::onResetBg, this));