+
+void SwapHeroes::OnResize(int width, int height) {
+ Vector<int> offset(parent->ScreenOffset());
+ // offset the cursor by 1/8th to the left and bottom
+ cursorOffset = Vector<int>(parent->Res().swapCursor->Width() / -8, parent->Res().swapCursor->Height() / 8);
+ indicatorOffset = Vector<int>(0, 0);
+
+ positions.clear();
+ positions.reserve(battle->NumHeroes());
+ for (int i(0), end(battle->NumHeroes()); i < end; ++i) {
+ Vector<int> positionCorrection(
+ parent->Res().swapCursor->Width() / 2,
+ parent->HeroTagAt(i).HeroSprite()->Height() - parent->Res().swapCursor->Height() / 2);
+ // indicator offsets are inverted for heroes
+ positionCorrection -= cursorOffset;
+ positions.push_back(parent->HeroTagPositionAt(i)
+ + parent->HeroTagAt(i).HeroOffset()
+ + positionCorrection
+ + offset);
+ }