Increase size of info in editor menu bar, show X/Y decimal places

When the text is slightly longer (e.g. X and Y positions having multiple digits), the font size of the info text in the menubar decreases because not enough space is available.

Show one decimal place also for the current world X and Y position of the mouse, which allows to determine the position of the mouse inside the currently hovered tile.
This commit is contained in:
Robert Müller 2023-06-14 00:11:00 +02:00
parent e22e0c9777
commit 7d9f4e1cfb

View file

@ -6001,7 +6001,7 @@ void CEditor::RenderMenubar(CUIRect MenuBar)
MenuBar.VSplitLeft(5.0f, nullptr, &MenuBar);
MenuBar.VSplitRight(20.0f, &MenuBar, &Close);
Close.VSplitLeft(5.0f, nullptr, &Close);
MenuBar.VSplitLeft(MenuBar.w * 0.75f, &MenuBar, &Info);
MenuBar.VSplitLeft(MenuBar.w * 0.6f, &MenuBar, &Info);
char aBuf[IO_MAX_PATH_LENGTH + 32];
str_format(aBuf, sizeof(aBuf), "File: %s", m_aFileName);
UI()->DoLabel(&MenuBar, aBuf, 10.0f, TEXTALIGN_ML);
@ -6009,7 +6009,7 @@ void CEditor::RenderMenubar(CUIRect MenuBar)
char aTimeStr[6];
str_timestamp_format(aTimeStr, sizeof(aTimeStr), "%H:%M");
str_format(aBuf, sizeof(aBuf), "X: %i, Y: %i, Z: %.1f, A: %.1f, G: %i %s", (int)UI()->MouseWorldX() / 32, (int)UI()->MouseWorldY() / 32, m_Zoom, m_AnimateSpeed, m_GridFactor, aTimeStr);
str_format(aBuf, sizeof(aBuf), "X: %.1f, Y: %.1f, Z: %.1f, A: %.1f, G: %i %s", UI()->MouseWorldX() / 32.0f, UI()->MouseWorldY() / 32.0f, m_Zoom, m_AnimateSpeed, m_GridFactor, aTimeStr);
UI()->DoLabel(&Info, aBuf, 10.0f, TEXTALIGN_MR);
static int s_CloseButton = 0;