fix(client): keep nutrient readouts on stable single-line rows
This commit is contained in:
+45
-1
@@ -13,6 +13,7 @@
|
||||
#include <filesystem>
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <limits>
|
||||
#include <source_location>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
@@ -357,7 +358,8 @@ void apply_save_restart() {
|
||||
std::filesystem::remove_all(dir);
|
||||
}
|
||||
void cellular_panels(const std::filesystem::path& review) {
|
||||
for (const auto& size : {std::pair{960, 640}, std::pair{1280, 800}, std::pair{640, 480}}) {
|
||||
for (const auto& size :
|
||||
{std::pair{960, 640}, std::pair{1280, 800}, std::pair{640, 480}, std::pair{1600, 1008}}) {
|
||||
const auto [width, height] = size;
|
||||
auto opened = Application::open({width, height, false, "software"});
|
||||
CHECK(opened);
|
||||
@@ -500,6 +502,48 @@ void cellular_panels(const std::filesystem::path& review) {
|
||||
if (width >= 880)
|
||||
CHECK(fits(ImGui::FindWindowByName("Field notes")) &&
|
||||
disjoint(vitals, ImGui::FindWindowByName("Field notes")));
|
||||
// Recording 2026-10-26 171124: "714 fg *" -> "1.54 pg *" wrapped the marker
|
||||
// and pushed every later nutrient down. Check the actual table geometry,
|
||||
// including the recording's 1.4 UI scale and every displayed mass unit.
|
||||
auto changing_stock = diagnostics;
|
||||
changing_stock.members = 1;
|
||||
changing_stock.growth_per_thousand = 540;
|
||||
changing_stock.growth_limit = 2;
|
||||
changing_stock.reserve_energy_pj = 2'360'000;
|
||||
changing_stock.reserve_matter_fg = {714, 374'000, 359'000, 300'000};
|
||||
float row_top = 0, table_height = 0, value_width = 0;
|
||||
for (const auto stock :
|
||||
{std::uint64_t{714}, std::uint64_t{999}, std::uint64_t{1'000}, std::uint64_t{1'540},
|
||||
std::uint64_t{9'999}, std::uint64_t{10'000}, std::uint64_t{999'999},
|
||||
std::uint64_t{1'000'000}, std::uint64_t{999'999'999}, std::uint64_t{1'000'000'000},
|
||||
std::numeric_limits<std::uint64_t>::max(), std::uint64_t{0}}) {
|
||||
changing_stock.reserve_matter_fg[0] = stock;
|
||||
perception.diagnostics = changing_stock;
|
||||
draw();
|
||||
auto* body = vitals->DC.ChildWindows[0];
|
||||
const auto* table = ImGui::TableFindByID(body->GetID("matter"));
|
||||
CHECK(table && table->ColumnsCount == 3 && body->ScrollMax.x == 0);
|
||||
if (row_top == 0) {
|
||||
row_top = table->RowPosY1;
|
||||
table_height = table->OuterRect.GetHeight();
|
||||
value_width = table->Columns[2].WidthGiven;
|
||||
}
|
||||
CHECK(table->RowPosY1 == row_top && table->OuterRect.GetHeight() == table_height);
|
||||
CHECK(table->Columns[2].WidthGiven == value_width);
|
||||
if (stock == std::numeric_limits<std::uint64_t>::max())
|
||||
CHECK(value_width >= ImGui::CalcTextSize("18446744074 \xC2\xB5g").x);
|
||||
if (!review.empty() && width == 1600 &&
|
||||
(stock == 714 || stock == 1'540 ||
|
||||
stock == std::numeric_limits<std::uint64_t>::max())) {
|
||||
std::filesystem::create_directories(review);
|
||||
CHECK(app->request_screenshot(
|
||||
(review / ("cellular-stock-" + std::to_string(stock) + ".bmp")).string()));
|
||||
draw();
|
||||
}
|
||||
}
|
||||
perception.diagnostics = diagnostics;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
draw();
|
||||
// Live messages may change overflow, but never move/resize the cards or
|
||||
// reflow their content width. Exercise every frame, including empty data.
|
||||
struct Geometry {
|
||||
|
||||
Reference in New Issue
Block a user