feat: Support for building ImHex for the web (#1328)

Co-authored-by: WerWolv <werwolv98@gmail.com>
Co-authored-by: AnnsAnn <git@annsann.eu>
This commit is contained in:
iTrooz
2023-10-04 12:00:32 +02:00
committed by GitHub
parent a62ede7840
commit d15bd4771d
84 changed files with 1825 additions and 676 deletions

View File

@@ -275,9 +275,10 @@ namespace hex::plugin::builtin {
auto format = (style == Style::Decimal) ? "{0}{1:d}" : ((style == Style::Hexadecimal) ? "{0}0x{1:X}" : "{0}0o{1:o}");
auto number = hex::crypt::decodeSleb128(buffer);
bool negative = number < 0;
auto value = hex::format(format, negative ? "-" : "", std::abs(number));
auto value = hex::format(format, negative ? "-" : "", negative ? -number : number);
return [value] { ImGui::TextUnformatted(value.c_str()); return value; };
},