Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for layout of large font labels in IEEE 745 floating point tool #1337

Merged
merged 17 commits into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions plugins/builtin/source/content/tools_entries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1397,13 +1397,12 @@ namespace hex::plugin::builtin {

const static auto IndentBoxOrLabel = [](
u32 startBit, u32 bitIndex, u32 count, bool isLabel) {
int columnWidth = ImGui::GetColumnWidth();
int checkBoxWidth;
std::string labelString = "xx";
checkBoxWidth = ImGui::CalcTextSize(labelString.c_str()).x + 1;
std::string labelString = "#";
checkBoxWidth = ImGui::CalcTextSize(labelString.c_str()).x + ImGui::GetStyle().FramePadding.x * 2.0f;
float result = checkBoxWidth * (startBit - bitIndex) + 1;
if (count < 4) {
result += (columnWidth - count * checkBoxWidth + 1) / 2.0f;
result += (ImGui::GetStyle().FramePadding.x + 0.5f);
}
if (isLabel) {
labelString = fmt::format("{}", startBit);
Expand Down