Fix incorrect layout with --trim and --sheet-pack

This commit is contained in:
Shiqing 2019-03-23 16:04:25 +08:00
parent ca1728fd38
commit 5d5aae7311
1 changed files with 6 additions and 6 deletions

View File

@ -376,14 +376,14 @@ public:
else
pr.pack(gfx::Size(width, height));
auto it = samples.begin();
for (auto& rc : pr) {
if (it->isDuplicated())
auto it = pr.begin();
for (auto& sample : samples) {
if (sample.isDuplicated() ||
sample.isEmpty())
continue;
ASSERT(it != samples.end());
it->setInTextureBounds(rc);
++it;
ASSERT(it != pr.end());
sample.setInTextureBounds(*(it++));
}
}
};