Transfer adjust call to applyposition

This transfers the responsibility of the adjust() call to
applyposition().

This is because cutscene text boxes (TEXTTRANSLATE_CUTSCENE) will have
adjust() called, but all other text boxes won't. And I can't place the
adjust() call inside applyposition(), because adjust() also calls
applyposition(), and that leads to an infinite loop which leads to a
stack overflow, so I had to remove the applyposition() call from
adjust(), and replace the other existing call to
Graphics::textboxadjust() with Graphics::textboxapplyposition(), and
then remove Graphics::textboxadjust() function because it's no longer
used.
This commit is contained in:
Misa
2024-01-21 10:48:39 -08:00
committed by Misa Elizabeth Kai
parent 3ef089ed3d
commit 28df0148b1
4 changed files with 5 additions and 15 deletions

View File

@@ -87,12 +87,15 @@ void textboxclass::applyposition(void)
{
centery();
}
if (translate == TEXTTRANSLATE_CUTSCENE)
{
adjust();
}
}
void textboxclass::adjust(void)
{
resize();
applyposition();
if (xp < 10) xp = 10;
if (yp < 10) yp = 10;
if (xp + w > 310) xp = 310 - w;