sim: textfields now support variable expansion

This commit is contained in:
openshwprojects
2022-12-04 00:23:40 +01:00
parent d32835556a
commit 96fc1bee6b
4 changed files with 19 additions and 4 deletions

View File

@@ -5,8 +5,12 @@ void CText::recalcBoundsSelf() {
bounds.clear();
int line = 0;
int ch = 0;;
const char *p = txt.c_str();
char buffer[512];
CMD_ExpandConstantsWithinString(txt.c_str(), buffer, sizeof(buffer));
const char *p = buffer;
bounds.addPoint(Coord(0, -8));
// do not go smaller than that
bounds.addPoint(Coord(9, 5));
while (*p) {
if (p[0] == '\n') {
line++;