Fixed bytes not being selectable when a read-only file was loaded
This most likely fixes #49
This commit is contained in:
parent
b06f5630c7
commit
f3d788de16
@ -254,7 +254,7 @@ struct MemoryEditor
|
|||||||
|
|
||||||
bool data_next = false;
|
bool data_next = false;
|
||||||
|
|
||||||
if (ReadOnly || DataEditingAddr >= mem_size)
|
if (DataEditingAddr >= mem_size)
|
||||||
DataEditingAddr = (size_t)-1;
|
DataEditingAddr = (size_t)-1;
|
||||||
if (DataPreviewAddr >= mem_size)
|
if (DataPreviewAddr >= mem_size)
|
||||||
DataPreviewAddr = (size_t)-1;
|
DataPreviewAddr = (size_t)-1;
|
||||||
@ -427,9 +427,9 @@ struct MemoryEditor
|
|||||||
else
|
else
|
||||||
ImGui::Text(format_byte_space, b);
|
ImGui::Text(format_byte_space, b);
|
||||||
}
|
}
|
||||||
if (!ReadOnly && ImGui::IsItemHovered() && ImGui::IsMouseClicked(0) && !ImGui::GetIO().KeyShift)
|
if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(0) && !ImGui::GetIO().KeyShift)
|
||||||
{
|
{
|
||||||
if (ImGui::IsMouseDoubleClicked(0)) {
|
if (!ReadOnly && ImGui::IsMouseDoubleClicked(0)) {
|
||||||
DataEditingTakeFocus = true;
|
DataEditingTakeFocus = true;
|
||||||
data_editing_addr_next = addr;
|
data_editing_addr_next = addr;
|
||||||
}
|
}
|
||||||
@ -440,7 +440,7 @@ struct MemoryEditor
|
|||||||
hex::Region selectionRegion { addr, 1 };
|
hex::Region selectionRegion { addr, 1 };
|
||||||
hex::View::postEvent(hex::Events::RegionSelected, &selectionRegion);
|
hex::View::postEvent(hex::Events::RegionSelected, &selectionRegion);
|
||||||
}
|
}
|
||||||
if (!ReadOnly && ImGui::IsItemHovered() && ((ImGui::IsMouseClicked(0) && ImGui::GetIO().KeyShift) || ImGui::IsMouseDragging(0))) {
|
if (ImGui::IsItemHovered() && ((ImGui::IsMouseClicked(0) && ImGui::GetIO().KeyShift) || ImGui::IsMouseDragging(0))) {
|
||||||
DataPreviewAddrEnd = addr;
|
DataPreviewAddrEnd = addr;
|
||||||
|
|
||||||
size_t dataPreviewStart = std::min(DataPreviewAddr, DataPreviewAddrEnd);
|
size_t dataPreviewStart = std::min(DataPreviewAddr, DataPreviewAddrEnd);
|
||||||
@ -495,9 +495,9 @@ struct MemoryEditor
|
|||||||
|
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
|
||||||
if (!ReadOnly && ImGui::IsItemHovered() && ImGui::IsMouseClicked(0) && !ImGui::GetIO().KeyShift)
|
if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(0) && !ImGui::GetIO().KeyShift)
|
||||||
{
|
{
|
||||||
if (ImGui::IsMouseDoubleClicked(0)) {
|
if (!ReadOnly && ImGui::IsMouseDoubleClicked(0)) {
|
||||||
DataEditingTakeFocus = true;
|
DataEditingTakeFocus = true;
|
||||||
data_editing_addr_next = addr;
|
data_editing_addr_next = addr;
|
||||||
}
|
}
|
||||||
@ -506,7 +506,7 @@ struct MemoryEditor
|
|||||||
DataPreviewAddrEnd = addr;
|
DataPreviewAddrEnd = addr;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!ReadOnly && ImGui::IsItemHovered() && ((ImGui::IsMouseClicked(0) && ImGui::GetIO().KeyShift) || ImGui::IsMouseDragging(0))) {
|
if (ImGui::IsItemHovered() && ((ImGui::IsMouseClicked(0) && ImGui::GetIO().KeyShift) || ImGui::IsMouseDragging(0))) {
|
||||||
DataPreviewAddrEnd = addr;
|
DataPreviewAddrEnd = addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user