1
0
mirror of synced 2025-02-20 12:11:04 +01:00

ux: Fix hex editor selection sometimes setting end to max address

This commit is contained in:
WerWolv 2022-06-14 11:58:50 +02:00
parent 5551e82fea
commit aed9d15625

View File

@ -32,7 +32,15 @@ namespace hex::plugin::builtin {
public:
void setSelection(const Region &region) { this->setSelection(region.getStartAddress(), region.getEndAddress()); }
void setSelection(i128 start, i128 end) {
if (!ImHexApi::Provider::isValid()) return;
if (!ImHexApi::Provider::isValid())
return;
if (start == InvalidSelection && end == InvalidSelection)
return;
if (start == InvalidSelection)
start = end;
if (end == InvalidSelection)
end = start;
const size_t maxAddress = ImHexApi::Provider::get()->getActualSize() - 1;