Skip to content

Commit f847807

Browse files
committed
fix: Buffer display data processor node being way too wide
#1644
1 parent 81982aa commit f847807

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugins/builtin/source/content/data_processor_nodes/visual_nodes.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ namespace hex::plugin::builtin {
6060
void drawNode() override {
6161
static const std::string Header = " Address 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ";
6262

63-
if (ImGui::BeginChild("##hex_view", scaled(ImVec2(ImGui::CalcTextSize(Header.c_str()).x, 200)), true)) {
63+
if (ImGui::BeginChild("##hex_view", ImVec2(ImGui::CalcTextSize(Header.c_str()).x, 200_scaled), true)) {
6464
ImGui::TextUnformatted(Header.c_str());
6565

6666
auto size = m_buffer.size();
6767
ImGuiListClipper clipper;
6868

6969
clipper.Begin((size + 0x0F) / 0x10);
7070

71-
while (clipper.Step())
71+
while (clipper.Step()) {
7272
for (auto y = clipper.DisplayStart; y < clipper.DisplayEnd; y++) {
7373
auto lineSize = ((size - y * 0x10) < 0x10) ? size % 0x10 : 0x10;
7474

@@ -94,6 +94,7 @@ namespace hex::plugin::builtin {
9494

9595
ImGui::TextUnformatted(line.c_str());
9696
}
97+
}
9798
clipper.End();
9899
}
99100
ImGui::EndChild();
@@ -119,13 +120,14 @@ namespace hex::plugin::builtin {
119120
ImGuiListClipper clipper;
120121
clipper.Begin((string.length() + (LineLength - 1)) / LineLength);
121122

122-
while (clipper.Step())
123+
while (clipper.Step()) {
123124
for (auto i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) {
124125
auto line = string.substr(i * LineLength, LineLength);
125126
ImGui::TextUnformatted("");
126127
ImGui::SameLine();
127128
ImGui::TextUnformatted(line.data(), line.data() + line.length());
128129
}
130+
}
129131

130132
clipper.End();
131133
}

0 commit comments

Comments
 (0)