fix: Edit -> Create Bookmark shortcut creating bookmark at wrong address
This commit is contained in:
parent
c618eec843
commit
daffa4e555
@ -250,14 +250,11 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
|
||||
ContentRegistry::Interface::addMenuItem("hex.builtin.menu.edit", 1050, [&] {
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
bool providerValid = ImHexApi::Provider::isValid();
|
||||
auto selection = ImHexApi::HexEditor::getSelection();
|
||||
|
||||
if (ImGui::MenuItem("hex.builtin.menu.edit.bookmark"_lang, nullptr, false, selection.has_value() && providerValid)) {
|
||||
auto base = provider->getBaseAddress();
|
||||
|
||||
ImHexApi::Bookmarks::add(base + selection->getStartAddress(), selection->size, {}, {});
|
||||
ImHexApi::Bookmarks::add(selection->getStartAddress(), selection->getSize(), {}, {});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -286,7 +286,7 @@ namespace hex::plugin::builtin {
|
||||
auto region = ImHexApi::HexEditor::getSelection();
|
||||
|
||||
if (region.has_value())
|
||||
ImHexApi::Bookmarks::add(region->address, region->size, {}, {});
|
||||
ImHexApi::Bookmarks::add(region->getStartAddress(), region->getSize(), {}, {});
|
||||
}
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
Loading…
x
Reference in New Issue
Block a user