Use grid bounds by default in Import Sprite Sheet (fix #1207)

This commit is contained in:
David Capello 2016-07-25 11:30:33 -03:00
parent ed7a1ef1cc
commit 0c6802cd30
2 changed files with 6 additions and 2 deletions

View File

@ -290,7 +290,7 @@
</section>
<section id="import_sprite_sheet">
<option id="type" type="app::SpriteSheetType" default="app::SpriteSheetType::Rows" />
<option id="bounds" type="gfx::Rect" default="gfx::Rect(0, 0, 16, 16)" />
<option id="bounds" type="gfx::Rect" default="gfx::Rect(0, 0, 0, 0)" />
<option id="partial_tiles" type="bool" default="false" />
</section>
<section id="preview" text="Preview">

View File

@ -217,7 +217,11 @@ private:
else
sheetType()->setSelectedItemIndex((int)app::SpriteSheetType::Rows-1);
onChangeRectangle(m_docPref->importSpriteSheet.bounds());
gfx::Rect defBounds = m_docPref->importSpriteSheet.bounds();
if (defBounds.isEmpty())
defBounds = m_docPref->grid.bounds();
onChangeRectangle(defBounds);
partialTiles()->setSelected(m_docPref->importSpriteSheet.partialTiles());
onEntriesChange();
}